﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Data;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    [StandardModule]
    internal sealed class ReportModule
    {
        public static string DV2C(int pDV)
        {
            switch (pDV)
            {
                case 2:
                    return "ngh\x00ecn";

                case 3:
                    return "triệu";

                case 4:
                    return "tỷ";
            }
            return "";
        }

        public static DataTable GetDataCanDoiSoPhatSinh(string strNamThang, string strKhoaDonVi, int intLoaiBaoCao)
        {
            DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[3];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@NamThang", DbType.Int64, ParameterDirection.Input, strNamThang);
                commandParameters[1] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, strKhoaDonVi);
                commandParameters[2] = DBHelper.createParameter("@LoaiBaoCao", DbType.Double, ParameterDirection.Input, intLoaiBaoCao);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "GL_BC_CanDoiSoPhatSinh", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public static DataTable GetDataCongNo(string strKhoaBC, string strTuNgay, string strDenNgay, string strKhoaDonVi, string strKhoaTaiKhoan, string strLoaiTien = "")
        {
            DataTable table;
            string listKhoaTaiKhoanCon = new clsDMTaiKhoan().GetListKhoaTaiKhoanCon(strKhoaTaiKhoan);
            IDataParameter[] commandParameters = new IDataParameter[8];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, strTuNgay);
                commandParameters[1] = DBHelper.createParameter("@DenNgay", DbType.Int64, ParameterDirection.Input, strDenNgay);
                commandParameters[2] = DBHelper.createParameter("@KhoaTaiKhoan", DbType.Int64, ParameterDirection.Input, strKhoaTaiKhoan);
                commandParameters[3] = DBHelper.createParameter("@KhoaBaoCao", DbType.Int64, ParameterDirection.Input, strKhoaBC);
                commandParameters[4] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                commandParameters[5] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, strKhoaDonVi.Trim());
                commandParameters[6] = DBHelper.createParameter("@ListKhoaTaiKhoan", DbType.Int64, ParameterDirection.Input, listKhoaTaiKhoanCon);
                commandParameters[7] = DBHelper.createParameter("@LoaiTien", DbType.Int64, ParameterDirection.Input, strLoaiTien);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "GL_BC_CongNoChiTiet", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public static DataTable GetDataCongNoChiTietHanThanhToan(string strKhoaBC, string strTuNgay, string strDenNgay, string strKhoaDonVi, string strKhoaTaiKhoan, string strLoaiTien = "")
        {
            DataTable table;
            string listKhoaTaiKhoanCon = new clsDMTaiKhoan().GetListKhoaTaiKhoanCon(strKhoaTaiKhoan);
            IDataParameter[] commandParameters = new IDataParameter[8];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, strTuNgay);
                commandParameters[1] = DBHelper.createParameter("@DenNgay", DbType.Int64, ParameterDirection.Input, strDenNgay);
                commandParameters[2] = DBHelper.createParameter("@KhoaTaiKhoan", DbType.Int64, ParameterDirection.Input, strKhoaTaiKhoan);
                commandParameters[3] = DBHelper.createParameter("@KhoaBaoCao", DbType.Int64, ParameterDirection.Input, strKhoaBC);
                commandParameters[4] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                commandParameters[5] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, strKhoaDonVi.Trim());
                commandParameters[6] = DBHelper.createParameter("@ListKhoaTaiKhoan", DbType.Int64, ParameterDirection.Input, listKhoaTaiKhoanCon);
                commandParameters[7] = DBHelper.createParameter("@LoaiTien", DbType.Int64, ParameterDirection.Input, strLoaiTien);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "GL_BC_CongNoChiTietHanThanhToan", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public static DataTable GetDataCongNoPhaiThu(string strKhoaBC, string strTuNgay, string strDenNgay, string strKhoaDonVi, string strKhoaTaiKhoan)
        {
            DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[6];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, strTuNgay);
                commandParameters[1] = DBHelper.createParameter("@DenNgay", DbType.Int64, ParameterDirection.Input, strDenNgay);
                commandParameters[2] = DBHelper.createParameter("@KhoaTaiKhoan", DbType.Int64, ParameterDirection.Input, strKhoaTaiKhoan);
                commandParameters[3] = DBHelper.createParameter("@KhoaBaoCao", DbType.Int64, ParameterDirection.Input, strKhoaBC);
                commandParameters[4] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                commandParameters[5] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, strKhoaDonVi);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "BC_sp_CongNoPhaiTra", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public static DataTable GetDataCongNoTongHop(string strKhoaBC, string strTuNgay, string strDenNgay, string strKhoaDonVi, string strKhoaTaiKhoan, string strLoaiTien = "")
        {
            DataTable table;
            string listKhoaTaiKhoanCon = new clsDMTaiKhoan().GetListKhoaTaiKhoanCon(strKhoaTaiKhoan);
            IDataParameter[] commandParameters = new IDataParameter[8];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, strTuNgay);
                commandParameters[1] = DBHelper.createParameter("@DenNgay", DbType.Int64, ParameterDirection.Input, strDenNgay);
                commandParameters[2] = DBHelper.createParameter("@KhoaTaiKhoan", DbType.Int64, ParameterDirection.Input, strKhoaTaiKhoan);
                commandParameters[3] = DBHelper.createParameter("@KhoaBaoCao", DbType.Int64, ParameterDirection.Input, strKhoaBC);
                commandParameters[4] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                commandParameters[5] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, strKhoaDonVi.Trim());
                commandParameters[6] = DBHelper.createParameter("@ListKhoaTaiKhoan", DbType.Int64, ParameterDirection.Input, listKhoaTaiKhoanCon);
                commandParameters[7] = DBHelper.createParameter("@LoaiTien", DbType.Int64, ParameterDirection.Input, strLoaiTien.Trim());
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "GL_BC_CongNoTongHop", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public static DataTable GetDataHangVeKho(string strNgay, string strKhoaDonVi, string strKhoaKho, int IntHienThi)
        {
            DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[5];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@Ngay", DbType.Int64, ParameterDirection.Input, strNgay);
                commandParameters[1] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, strKhoaDonVi.Trim());
                commandParameters[2] = DBHelper.createParameter("@KhoaKho", DbType.Int64, ParameterDirection.Input, strKhoaKho);
                commandParameters[3] = DBHelper.createParameter("@HienThi", DbType.Double, ParameterDirection.Input, IntHienThi);
                commandParameters[4] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "Get_HangTrenDuongVeKho", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public static DataTable GetDataSoCaiTaiKhoan(string strKhoaBC, string strTuNgay, string strDenNgay, string strKhoaDonVi)
        {
            DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[5];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, strTuNgay);
                commandParameters[1] = DBHelper.createParameter("@DenNgay", DbType.Int64, ParameterDirection.Input, strDenNgay);
                commandParameters[2] = DBHelper.createParameter("@KhoaBaoCao", DbType.Int64, ParameterDirection.Input, strKhoaBC);
                commandParameters[3] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                commandParameters[4] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, strKhoaDonVi);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "BC_sp_SoChiTietTaiKhoan", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public static void InitDuLieuDanhMuc(string pKhoaBC, object objVS, int nColKey, int nColCheck, string strLoai = "")
        {
            int num2 = Conversions.ToInteger(Microsoft.VisualBasic.CompilerServices.Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateGet(objVS, null, "Rows", new object[0], null, null, null), null, "Count", new object[0], null, null, null), 1));
            for (int i = 1; i <= num2; i++)
            {
                object[] arguments = new object[] { i, nColCheck };
                bool[] copyBack = new bool[] { true, true };
                if (copyBack[0])
                {
                    i = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(int));
                }
                if (copyBack[1])
                {
                    nColCheck = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[1]), typeof(int));
                }
                if (Conversion.Val(RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(objVS, null, "Item", arguments, null, null, copyBack))) != 0.0)
                {
                    string[] strArray = new string[7];
                    strArray[0] = "INSERT INTO BC_DuLieuDanhMuc (KhoaDanhMuc, KhoaBaoCao, Loai)  VALUES ('";
                    object[] objArray4 = new object[] { i, nColKey };
                    bool[] flagArray2 = new bool[] { true, true };
                    if (flagArray2[0])
                    {
                        i = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray4[0]), typeof(int));
                    }
                    if (flagArray2[1])
                    {
                        nColKey = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray4[1]), typeof(int));
                    }
                    strArray[1] = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(objVS, null, "Item", objArray4, null, null, flagArray2)), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    strArray[2] = "','";
                    strArray[3] = pKhoaBC.ToString().Trim();
                    strArray[4] = "','";
                    strArray[5] = LVYModule.sLeft(strLoai.Trim(), 2);
                    strArray[6] = "')";
                    string commandText = string.Concat(strArray);
                    DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]);
                }
            }
        }

        public static string N2C(string pN, int pTT, int pLen, string pNumFront)
        {
            string str=String.Empty;
            string str2 = pN;
            if (str2 == "0")
            {
                if (pTT == 1)
                {
                    str = "kh\x00f4ng trăm";
                }
                if (pTT == 2)
                {
                    str = "lẻ";
                }
            }
            else
            {
                switch (str2)
                {
                    case "2":
                        str = "hai";
                        break;

                    case "3":
                        str = "ba";
                        break;

                    case "4":
                        str = "bốn";
                        break;

                    case "5":
                        if (pLen == 3)
                        {
                            if (pTT == 3)
                            {
                                if (pNumFront == "0")
                                {
                                    str = "năm";
                                }
                                else
                                {
                                    str = "lăm";
                                }
                            }
                            else
                            {
                                str = "năm";
                            }
                        }
                        else if (pLen == 2)
                        {
                            if (pTT == 2)
                            {
                                if (pNumFront == "0")
                                {
                                    str = "năm";
                                }
                                else
                                {
                                    str = "lăm";
                                }
                            }
                            else
                            {
                                str = "năm";
                            }
                        }
                        else
                        {
                            str = "năm";
                        }
                        break;

                    case "1":
                        if (pLen == 3)
                        {
                            if (pTT == 3)
                            {
                                if ((pNumFront == "1") | (pNumFront == "0"))
                                {
                                    str = "một";
                                }
                                else
                                {
                                    str = "mốt";
                                }
                            }
                            if (pTT == 2)
                            {
                                str = "mười";
                            }
                            if (pTT == 1)
                            {
                                str = "một trăm";
                            }
                        }
                        if (pLen == 2)
                        {
                            if (pTT == 2)
                            {
                                if ((pNumFront == "1") | (pNumFront == "0"))
                                {
                                    str = "một";
                                }
                                else
                                {
                                    str = "mốt";
                                }
                            }
                            if (pTT == 1)
                            {
                                str = "mười";
                            }
                        }
                        if (pLen == 1)
                        {
                            str = "một";
                        }
                        break;

                    case "6":
                        str = "s\x00e1u";
                        break;

                    case "7":
                        str = "bảy";
                        break;

                    case "8":
                        str = "t\x00e1m";
                        break;

                    case "9":
                        str = "ch\x00edn";
                        break;
                }
            }
            if ((pLen == 3) & ((pN != "0") & (pN != "1")))
            {
                if (pTT == 1)
                {
                    str = str + " trăm";
                }
                if (pTT == 2)
                {
                    str = str + " mươi";
                }
            }
            if (((pLen == 2) & ((pN != "0") & (pN != "1"))) && (pTT == 1))
            {
                str = str + " mươi";
            }
            return str;
        }

        public static string Number2Char(string pChar, string pCharThapPhan = ".")
        {
            string str7=String.Empty;
            object instance = pChar.Split(new char[] { Conversions.ToChar(pCharThapPhan) });
            if (Information.UBound((Array) instance, 1) > 0)
            {
                string str5;
                if (pCharThapPhan.Trim() == ".")
                {
                    str5 = " chấm ";
                }
                else
                {
                    str5 = " phảy ";
                }
                return (Number2Char(Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null)), ".") + str5 + Number2Char(Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null)), "."));
            }
            bool flag = false;
            int pDV = 0;
            if (LVYModule.sLeft(pChar, 1) == "-")
            {
                pChar = LVYModule.sRight(pChar.Trim(), pChar.Length - 1);
            }
            string str3 = "";
            while (!flag)
            {
                string str8=String.Empty;
                int num3;
                string expression = Strings.Right(Strings.Trim(pChar), 3);
                pDV++;
                if (Strings.Len(pChar) > 3)
                {
                    pChar = Strings.Left(pChar, Strings.Len(pChar) - 3);
                }
                else
                {
                    pChar = "";
                    flag = true;
                }
                int lenght = Strings.Len(expression);
                goto Label_02D0;
            Label_015D:
                if (expression != LVYModule.sRight("000", Strings.Len(expression)))
                {
                    if (lenght < Strings.Len(expression))
                    {
                        str3 = LVYModule.sRight(expression, lenght);
                        if (lenght > 1)
                        {
                            if (str3 != LVYModule.sRight("000", lenght))
                            {
                                str8 = N2C(Strings.Mid(expression, lenght, 1), lenght, Strings.Len(expression), Strings.Mid(expression, lenght - 1, 1)) + " " + Strings.Trim(str8);
                            }
                        }
                        else
                        {
                            str8 = N2C(Strings.Mid(expression, lenght, 1), lenght, Strings.Len(expression), "") + " " + Strings.Trim(str8);
                        }
                    }
                    else if (Strings.Mid(expression, lenght, 1) != "0")
                    {
                        if (lenght > 1)
                        {
                            str8 = N2C(Strings.Mid(expression, lenght, 1), lenght, Strings.Len(expression), Strings.Mid(expression, lenght - 1, 1)) + " " + Strings.Trim(str8);
                        }
                        else
                        {
                            str8 = N2C(Strings.Mid(expression, lenght, 1), lenght, Strings.Len(expression), "") + " " + Strings.Trim(str8);
                        }
                    }
                }
                lenght += -1;
            Label_02D0:
                num3 = 1;
                if (lenght >= num3)
                {
                    goto Label_015D;
                }
                if (Strings.Trim(str7) == "")
                {
                    if (Strings.Trim(str8) == "")
                    {
                        if ((Strings.Len(pChar) + Strings.Len(expression)) <= 3)
                        {
                            str7 = DV2C(pDV) + " " + str7;
                        }
                    }
                    else
                    {
                        str7 = DV2C(pDV) + " " + str7;
                    }
                }
                else if (Strings.Trim(str8) != "")
                {
                    str7 = Strings.Trim(DV2C(pDV)) + " " + Strings.Trim(str7);
                }
                str7 = Strings.Trim(str8) + " " + Strings.Trim(str7);
                str8 = "";
            }
            return (Strings.UCase(Strings.Mid(str7, 1, 1)) + Strings.Mid(str7, 2, Strings.Len(str7) - 1));
        }

        public static void PrintBaoGia(string pKhoa, string strLanguage = "VIET", int InTotal = 0)
        {
            ClsBaoGia gia = new ClsBaoGia();
            clsDMLoaiTien tien = new clsDMLoaiTien();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            gia.Load(pKhoa);
            tien.LoadByCode(gia.LoaiTien.Trim());
            DataTable dataPrint = gia.GetDataPrint(pKhoa, strLanguage);
            DataTable dataPrintDK = gia.GetDataPrintDK(pKhoa, strLanguage);
            string str2 = "";
            string val = "";
            string str3 = "";
            if (modGeneral.H_HOTLINE.Trim() != "")
            {
                str2 = "Hotline: " + modGeneral.H_HOTLINE;
            }
            if (modGeneral.H_EMAIL.Trim() != "")
            {
                val = "EMail: " + modGeneral.H_EMAIL;
            }
            if (modGeneral.H_WEBSITE.Trim() != "")
            {
                str3 = "Website: " + modGeneral.H_WEBSITE;
            }
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BaoGia gia2 = new Rpt_BaoGia();
                try
                {
                    gia2.SetDataSource(dataPrint);
                    gia2.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    gia2.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                    gia2.Subreports[2].SetDataSource(dataPrintDK);
                    gia2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    gia2.SetParameterValue(1, "Add: " + modGeneral.H_ADDRESSANH);
                    gia2.SetParameterValue(2, "Tel: " + modGeneral.H_TELEPHONE + "  Fax: " + modGeneral.H_FAX + "  " + str2);
                    gia2.SetParameterValue(3, val);
                    gia2.SetParameterValue(4, str3);
                    gia2.SetParameterValue(5, modGeneral.Tranlated("BẢNG CH\x00c0O GI\x00c1", strLanguage));
                    gia2.SetParameterValue(6, modGeneral.Tranlated("Số", strLanguage) + ":" + gia.SoChungTu.Trim());
                    gia2.SetParameterValue(7, modGeneral.Tranlated("Ng\x00e0y", strLanguage) + ":" + LVYModule.Char2Date(gia.NgayChungTu));
                    gia2.SetParameterValue(8, modGeneral.Tranlated("K\x00ednh gởi", strLanguage));
                    gia2.SetParameterValue(9, modGeneral.Tranlated("Người nhận", strLanguage));
                    gia2.SetParameterValue(10, modGeneral.Tranlated("Điện thoại", strLanguage));
                    gia2.SetParameterValue(11, modGeneral.Tranlated("Fax", ""));
                    gia2.SetParameterValue(12, modGeneral.Tranlated("Email", ""));
                    gia2.SetParameterValue(13, modGeneral.Tranlated("STT", ""));
                    gia2.SetParameterValue(14, modGeneral.Tranlated("M\x00e3 h\x00e0ng", strLanguage));
                    gia2.SetParameterValue(15, modGeneral.Tranlated("Diễn giải", strLanguage));
                    gia2.SetParameterValue(0x10, modGeneral.Tranlated("Xuất xứ", strLanguage));
                    gia2.SetParameterValue(0x11, modGeneral.Tranlated("ĐVT", strLanguage));
                    gia2.SetParameterValue(0x12, modGeneral.Tranlated("Đơn gi\x00e1", strLanguage));
                    gia2.SetParameterValue(0x13, modGeneral.Tranlated("VAT", ""));
                    gia2.SetParameterValue(20, modGeneral.Tranlated("Th\x00e0nh tiền", strLanguage));
                    gia2.SetParameterValue(0x15, modGeneral.Tranlated("Model", "") + ": ");
                    gia2.SetParameterValue(0x16, modGeneral.Tranlated("Tr\x00e2n trọng k\x00ednh ch\x00e0o", strLanguage));
                    gia2.SetParameterValue(0x17, modGeneral.Tranlated("X\x00e1c nhận đặt h\x00e0ng", strLanguage));
                    gia2.SetParameterValue(0x18, "(" + modGeneral.Tranlated("K\x00fd t\x00ean, đ\x00f3ng dấu", strLanguage) + ")");
                    gia2.SetParameterValue(0x19, modGeneral.Tranlated("H\x00e3ng", strLanguage));
                    gia2.SetParameterValue(0x1a, modGeneral.Tranlated("Ghi ch\x00fa", strLanguage));
                    gia2.SetParameterValue(0x1b, modGeneral.Tranlated("Địa chỉ", strLanguage));
                    gia2.SetParameterValue(0x1c, modGeneral.Tranlated("S.L", strLanguage));
                    gia2.SetParameterValue(0x1d, tien.SoLe);
                    clsDMDoiTuong tuong = new clsDMDoiTuong();
                    tuong.Load(gia.KhoaKhachHang);
                    gia2.SetParameterValue(30, tuong.DiaChi);
                    gia2.SetParameterValue(0x1f, InTotal);
                    gia2.SetParameterValue(0x20, modGeneral.Tranlated("Tổng cộng", strLanguage) + ":");
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = gia2;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintBaoGia2(string pKhoa, string strLanguage = "VIET", int InTotal = 0)
        {
            ClsBaoGia gia = new ClsBaoGia();
            clsDMLoaiTien tien = new clsDMLoaiTien();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            gia.Load(pKhoa);
            tien.LoadByCode(gia.LoaiTien.Trim());
            DataTable dataPrint = gia.GetDataPrint(pKhoa, strLanguage);
            DataTable dataPrintDK = gia.GetDataPrintDK(pKhoa, strLanguage);
            string str2 = "";
            string val = "";
            string str3 = "";
            if (modGeneral.H_HOTLINE.Trim() != "")
            {
                str2 = "Hotline: " + modGeneral.H_HOTLINE;
            }
            if (modGeneral.H_EMAIL.Trim() != "")
            {
                val = "EMail: " + modGeneral.H_EMAIL;
            }
            if (modGeneral.H_WEBSITE.Trim() != "")
            {
                str3 = "Website: " + modGeneral.H_WEBSITE;
            }
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BaoGia2 gia2 = new Rpt_BaoGia2();
                try
                {
                    gia2.SetDataSource(dataPrint);
                    gia2.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    gia2.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                    gia2.Subreports[2].SetDataSource(dataPrintDK);
                    gia2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    gia2.SetParameterValue(1, "Add: " + modGeneral.H_ADDRESSANH);
                    gia2.SetParameterValue(2, "Tel: " + modGeneral.H_TELEPHONE + "  Fax: " + modGeneral.H_FAX + "  " + str2);
                    gia2.SetParameterValue(3, val);
                    gia2.SetParameterValue(4, str3);
                    gia2.SetParameterValue(5, modGeneral.Tranlated("BẢNG CH\x00c0O GI\x00c1", strLanguage));
                    gia2.SetParameterValue(6, modGeneral.Tranlated("Số", strLanguage) + ":" + gia.SoChungTu.Trim());
                    gia2.SetParameterValue(7, modGeneral.Tranlated("Ng\x00e0y", strLanguage) + ":" + LVYModule.Char2Date(gia.NgayChungTu));
                    gia2.SetParameterValue(8, modGeneral.Tranlated("K\x00ednh gởi", strLanguage));
                    gia2.SetParameterValue(9, modGeneral.Tranlated("Người nhận", strLanguage));
                    gia2.SetParameterValue(10, modGeneral.Tranlated("Điện thoại", strLanguage));
                    gia2.SetParameterValue(11, modGeneral.Tranlated("Fax", ""));
                    gia2.SetParameterValue(12, modGeneral.Tranlated("Email", ""));
                    gia2.SetParameterValue(13, modGeneral.Tranlated("STT", ""));
                    gia2.SetParameterValue(14, modGeneral.Tranlated("M\x00e3 h\x00e0ng", strLanguage));
                    gia2.SetParameterValue(15, modGeneral.Tranlated("Diễn giải", strLanguage));
                    gia2.SetParameterValue(0x10, modGeneral.Tranlated("Xuất xứ", strLanguage));
                    gia2.SetParameterValue(0x11, modGeneral.Tranlated("ĐVT", strLanguage));
                    gia2.SetParameterValue(0x12, modGeneral.Tranlated("Đơn gi\x00e1", strLanguage));
                    gia2.SetParameterValue(0x13, modGeneral.Tranlated("VAT", ""));
                    gia2.SetParameterValue(20, modGeneral.Tranlated("Th\x00e0nh tiền", strLanguage));
                    gia2.SetParameterValue(0x15, modGeneral.Tranlated("Model", "") + ": ");
                    gia2.SetParameterValue(0x16, modGeneral.Tranlated("Tr\x00e2n trọng k\x00ednh ch\x00e0o", strLanguage));
                    gia2.SetParameterValue(0x17, modGeneral.Tranlated("X\x00e1c nhận đặt h\x00e0ng", strLanguage));
                    gia2.SetParameterValue(0x18, "(" + modGeneral.Tranlated("K\x00fd t\x00ean, đ\x00f3ng dấu", strLanguage) + ")");
                    gia2.SetParameterValue(0x19, modGeneral.Tranlated("H\x00e3ng", strLanguage));
                    gia2.SetParameterValue(0x1a, modGeneral.Tranlated("Ghi ch\x00fa", strLanguage));
                    gia2.SetParameterValue(0x1b, modGeneral.Tranlated("Địa chỉ", strLanguage));
                    gia2.SetParameterValue(0x1c, modGeneral.Tranlated("S.L", strLanguage));
                    gia2.SetParameterValue(0x1d, tien.SoLe);
                    clsDMDoiTuong tuong = new clsDMDoiTuong();
                    tuong.Load(gia.KhoaKhachHang);
                    gia2.SetParameterValue(30, tuong.DiaChi);
                    gia2.SetParameterValue(0x1f, InTotal);
                    gia2.SetParameterValue(0x20, modGeneral.Tranlated("Tổng cộng", strLanguage) + ":");
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = gia2;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintChungTuTongHop(string strKhoa)
        {
            clsTongHop hop = new clsTongHop();
            string strTKNo = "";
            string strTKCo = "";
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            hop.Load(strKhoa);
            hop.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            DataTable dataPrint = hop.GetDataPrint(strKhoa);
            if ((dataPrint == null) | (dataPrint.Rows.Count == 0))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                double soTien = hop.SoTien;
                RptPhieuKeToan toan = new RptPhieuKeToan();
                try
                {
                    toan.SetDataSource(dataPrint);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        toan.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        toan.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    toan.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    toan.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    toan.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    toan.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    toan.SetParameterValue(5, modGeneral.Tranlated("PHIẾU KẾ TO\x00c1N", ""));
                    toan.SetParameterValue(6, modGeneral.Tranlated("Số chứng từ", ""));
                    toan.SetParameterValue(8, "Ng\x00e0y " + LVYModule.sRight(Conversions.ToString(dataPrint.Rows[0]["NgayChungTu"]), 2) + " th\x00e1ng " + LVYModule.sMid(Conversions.ToString(dataPrint.Rows[0]["NgayChungTu"]), 5, 2) + " năm " + LVYModule.sLeft(Conversions.ToString(dataPrint.Rows[0]["NgayChungTu"]), 4));
                    toan.SetParameterValue(9, modGeneral.Tranlated("Số TK", ""));
                    toan.SetParameterValue(10, modGeneral.Tranlated("Vế", ""));
                    toan.SetParameterValue(11, modGeneral.Tranlated(" Đối tượng", ""));
                    toan.SetParameterValue(12, modGeneral.Tranlated("Số tiền", ""));
                    toan.SetParameterValue(13, modGeneral.Tranlated("Quy đổi", ""));
                    toan.SetParameterValue(14, modGeneral.Tranlated("Diễn giải", ""));
                    toan.SetParameterValue(15, modGeneral.Tranlated("Ng\x00e0y ...... th\x00e1ng ...... năm ...............", ""));
                    toan.SetParameterValue(0x10, modGeneral.Tranlated("Người lập phiếu", ""));
                    toan.SetParameterValue(0x11, modGeneral.Tranlated("Người giao tiền", ""));
                    toan.SetParameterValue(0x12, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    toan.SetParameterValue(0x13, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", ""));
                    toan.SetParameterValue(0x15, "Số tiền bằng chữ :" + Number2Char(Conversions.ToString(soTien), ".") + " (" + hop.LoaiTien.Trim() + ")");
                    toan.SetParameterValue(7, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo);
                    toan.SetParameterValue(20, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = toan;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintDataDKBaoGia(string pKhoa)
        {
            DataTable dataPrintDK = new ClsBaoGia().GetDataPrintDK(pKhoa, "VIET");
            if (dataPrintDK.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_DieuKhoanBaoGia gia2 = new Rpt_DieuKhoanBaoGia();
                try
                {
                    gia2.SetDataSource(dataPrintDK);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = gia2;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintDatHang(string strKhoa, string strLanguage)
        {
            clsDonDatHang hang = new clsDonDatHang();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            hang.Load(strKhoa);
            DataTable dataPrintSaleOrder = hang.GetDataPrintSaleOrder(strKhoa, strLanguage);
            if (dataPrintSaleOrder != null)
            {
                if (dataPrintSaleOrder.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
                }
                else
                {
                    if (dataPrintSaleOrder == null)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu!", ""));
                    }
                    if (dataPrintSaleOrder.Rows.Count == 0)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu!", ""));
                    }
                    Rpt_SaleOrder order = new Rpt_SaleOrder();
                    try
                    {
                        order.SetDataSource(dataPrintSaleOrder);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            order.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            order.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        order.SetParameterValue(1, modGeneral.H_ADDRESS);
                        order.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                        order.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                        order.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                        order.SetParameterValue(5, modGeneral.Tranlated("ĐƠN ĐẶT H\x00c0NG", ""));
                        order.SetParameterValue(6, modGeneral.Tranlated("ĐẶT H\x00c0NG TỪ", strLanguage));
                        order.SetParameterValue(7, modGeneral.Tranlated("Nh\x00e0 cung cấp", strLanguage));
                        order.SetParameterValue(8, modGeneral.Tranlated("Số đơn h\x00e0ng", strLanguage));
                        order.SetParameterValue(9, modGeneral.Tranlated("Ng\x00e0y đặt h\x00e0ng", strLanguage));
                        order.SetParameterValue(10, modGeneral.Tranlated("Số tờ", strLanguage));
                        order.SetParameterValue(11, modGeneral.Tranlated("KH\x00c1CH H\x00c0NG", strLanguage));
                        order.SetParameterValue(12, modGeneral.Tranlated("TH\x00d4NG TIN ĐƠN H\x00c0NG", strLanguage));
                        order.SetParameterValue(13, modGeneral.Tranlated("ĐIỀU KHOẢN B\x00c1N H\x00c0NG", strLanguage));
                        order.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ giao h\x00e0ng", strLanguage));
                        order.SetParameterValue(15, modGeneral.Tranlated("Thuế VAT", strLanguage));
                        order.SetParameterValue(0x10, modGeneral.Tranlated("Vận chuyển", strLanguage));
                        order.SetParameterValue(0x11, modGeneral.Tranlated("Hạn giao h\x00e0ng", strLanguage));
                        order.SetParameterValue(0x12, modGeneral.Tranlated("Thanh to\x00e1n", strLanguage));
                        order.SetParameterValue(0x13, modGeneral.Tranlated("STT", strLanguage));
                        order.SetParameterValue(20, modGeneral.Tranlated("T\x00ean h\x00e0ng", strLanguage));
                        order.SetParameterValue(0x15, modGeneral.Tranlated("M\x00e3 h\x00e0ng", strLanguage));
                        order.SetParameterValue(0x16, modGeneral.Tranlated("Số lượng", strLanguage));
                        order.SetParameterValue(0x17, modGeneral.Tranlated("Đơn gi\x00e1", strLanguage));
                        order.SetParameterValue(0x18, modGeneral.Tranlated("Th\x00e0nh tiền", strLanguage));
                        order.SetParameterValue(0x19, modGeneral.Tranlated("Loại tiền", strLanguage));
                        order.SetParameterValue(0x1a, modGeneral.Tranlated("Lập biểu", strLanguage));
                        order.SetParameterValue(0x1b, modGeneral.Tranlated("Li\x00ean hệ", ""));
                        order.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền", strLanguage));
                        order.SetParameterValue(0x1d, modGeneral.Tranlated("Tổng thuế", strLanguage));
                        order.SetParameterValue(30, modGeneral.Tranlated("Tổng thanh to\x00e1n", strLanguage));
                        order.SetParameterValue(0x1f, hang.LoaiTien);
                        clsDMLoaiTien tien = new clsDMLoaiTien();
                        tien.LoadByCode(hang.LoaiTien.Trim());
                        order.SetParameterValue(0x20, tien.SoLe);
                        MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = order;
                        MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                        if (Form.ActiveForm != null)
                        {
                            Form.ActiveForm.Cursor = Cursors.Default;
                        }
                        MyProject.Forms.Frm_ViewReport.ShowDialog();
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintGiayBaoCo(string strKhoa)
        {
            clsChungTuQuy quy = new clsChungTuQuy();
            string strTKNo = "";
            string strTKCo = "";
            double num = 0.0;
            quy.Load(strKhoa);
            clsDMDoiTuong tuong = new clsDMDoiTuong();
            tuong.Load(quy.KhoaDoiTuong);
            num = Convert.ToDouble(quy.SoTien);
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            DataTable dataPrintBaoCo = quy.GetDataPrintBaoCo(strKhoa);
            quy.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            if (dataPrintBaoCo.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                RptGiayBaoCo co = new RptGiayBaoCo();
                try
                {
                    co.SetDataSource(dataPrintBaoCo);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        co.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        co.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    co.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    co.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    co.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    co.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    co.SetParameterValue(5, modGeneral.Tranlated("GIẤY B\x00c1O C\x00d3 NG\x00c2N H\x00c0NG", ""));
                    co.SetParameterValue(6, modGeneral.Tranlated("Năm th\x00e1ng", ""));
                    co.SetParameterValue(7, "Số: " + quy.SoChungTu);
                    co.SetParameterValue(8, "Ng\x00e0y " + LVYModule.sRight(quy.NgayChungTu, 2) + " th\x00e1ng " + LVYModule.sMid(quy.NgayChungTu, 5, 2) + " năm " + LVYModule.sLeft(quy.NgayChungTu, 4));
                    co.SetParameterValue(9, "Địa chỉ : " + quy.DiaChi);
                    co.SetParameterValue(10, "Người nộp tiền: " + quy.NguoiDaiDien);
                    co.SetParameterValue(11, modGeneral.Tranlated("Số tiền :", ""));
                    co.SetParameterValue(12, modGeneral.Tranlated("L\x00fd do nộp :", ""));
                    co.SetParameterValue(13, modGeneral.Tranlated("Loại tiền :", ""));
                    co.SetParameterValue(14, modGeneral.Tranlated("K\x00e8m theo :", ""));
                    co.SetParameterValue(15, "Bằng chữ :" + Number2Char(Conversions.ToString(Math.Round(quy.SoTien, 0)), ".") + " (" + quy.LoaiTien.Trim() + ")");
                    co.SetParameterValue(0x10, quy.SoTien);
                    co.SetParameterValue(0x11, modGeneral.Tranlated("K\x00e8m theo :", ""));
                    co.SetParameterValue(0x12, modGeneral.Tranlated("Chứng từ gốc", ""));
                    co.SetParameterValue(0x13, modGeneral.Tranlated("Ng\x00e0y ...... th\x00e1ng ...... năm ...............", ""));
                    co.SetParameterValue(0x15, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    co.SetParameterValue(20, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    co.SetParameterValue(0x16, modGeneral.Tranlated("Người lập phiếu", ""));
                    co.SetParameterValue(0x17, modGeneral.Tranlated("Người giao tiền", ""));
                    co.SetParameterValue(0x18, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    co.SetParameterValue(0x19, modGeneral.Tranlated("Thủ quỹ", ""));
                    co.SetParameterValue(0x1a, modGeneral.Tranlated("Thủ trưởng", ""));
                    co.SetParameterValue(0x1b, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", ""));
                    co.SetParameterValue(0x1c, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo);
                    co.SetParameterValue(0x1d, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo);
                    co.SetParameterValue(30, modGeneral.Tranlated("Ng\x00e2n h\x00e0ng :", "") + tuong.Ten());
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = co;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintGiayBaoNo(string strKhoa)
        {
            clsChungTuQuy quy = new clsChungTuQuy();
            string strTKNo = "";
            string strTKCo = "";
            double num = 0.0;
            quy.Load(strKhoa);
            clsDMDoiTuong tuong = new clsDMDoiTuong();
            tuong.Load(quy.KhoaDoiTuong);
            num = Convert.ToDouble(quy.SoTien);
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            DataTable dataPrintBaoNo = quy.GetDataPrintBaoNo(strKhoa);
            quy.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            if (dataPrintBaoNo.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                RptGiayBaoNo no = new RptGiayBaoNo();
                try
                {
                    no.SetDataSource(dataPrintBaoNo);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        no.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        no.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    no.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    no.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    no.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    no.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    no.SetParameterValue(5, modGeneral.Tranlated("GIẤY B\x00c1O NỢ NG\x00c2N H\x00c0NG", ""));
                    no.SetParameterValue(6, modGeneral.Tranlated("Năm th\x00e1ng", ""));
                    no.SetParameterValue(7, "Số: " + quy.SoChungTu);
                    no.SetParameterValue(8, "Ng\x00e0y " + LVYModule.sRight(quy.NgayChungTu, 2) + " th\x00e1ng " + LVYModule.sMid(quy.NgayChungTu, 5, 2) + " năm " + LVYModule.sLeft(quy.NgayChungTu, 4));
                    no.SetParameterValue(9, "Địa chỉ : " + quy.DiaChi);
                    no.SetParameterValue(10, "Người nhận tiền: " + quy.NguoiDaiDien);
                    no.SetParameterValue(11, modGeneral.Tranlated("Số tiền :", ""));
                    no.SetParameterValue(12, modGeneral.Tranlated("L\x00fd do nộp :", ""));
                    no.SetParameterValue(13, modGeneral.Tranlated("Loại tiền :", ""));
                    no.SetParameterValue(14, modGeneral.Tranlated("K\x00e8m theo :", ""));
                    no.SetParameterValue(15, "Bằng chữ :" + Number2Char(Conversions.ToString(Math.Round(quy.SoTien, 0)), ".") + " (" + quy.LoaiTien.Trim() + ")");
                    no.SetParameterValue(0x10, quy.SoTien);
                    no.SetParameterValue(0x11, modGeneral.Tranlated("K\x00e8m theo :", ""));
                    no.SetParameterValue(0x12, modGeneral.Tranlated("Chứng từ gốc", ""));
                    no.SetParameterValue(0x13, modGeneral.Tranlated("Ng\x00e0y ...... th\x00e1ng ...... năm ...............", ""));
                    no.SetParameterValue(0x15, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    no.SetParameterValue(20, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    no.SetParameterValue(0x16, modGeneral.Tranlated("Người lập phiếu", ""));
                    no.SetParameterValue(0x17, modGeneral.Tranlated("Người giao tiền", ""));
                    no.SetParameterValue(0x18, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    no.SetParameterValue(0x19, modGeneral.Tranlated("Thủ quỹ", ""));
                    no.SetParameterValue(0x1a, modGeneral.Tranlated("Thủ trưởng", ""));
                    no.SetParameterValue(0x1b, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", ""));
                    no.SetParameterValue(0x1c, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo);
                    no.SetParameterValue(0x1d, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo);
                    no.SetParameterValue(30, modGeneral.Tranlated("Ng\x00e2n h\x00e0ng :", "") + tuong.Ten());
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = no;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintHoaDon(string strKhoa)
        {
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            double num = 0.0;
            string strTKNo = "";
            string strTKCo = "";
            clsDMLoaiTien tien = new clsDMLoaiTien();
            string str = "";
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            clsDMDoiTuong tuong = new clsDMDoiTuong();
            tuong.Load(kho.KhoaDoiTuong);
            tien.LoadByCode(kho.LoaiTien.Trim());
            num = (kho.TienHang + kho.TienThueVAT) - kho.TienChietKhau;
            num = Math.Round(num, 0);
            DataTable dataPrint = kho.GetDataPrint(strKhoa, "VIET");
            DataTable dataPrintDK = kho.GetDataPrintDK(strKhoa, modGeneral.H_LANGUAGE);
            clsDMPhuongThucThanhToan toan = new clsDMPhuongThucThanhToan();
            toan.Load(kho.KhoaKhoanMuc);
            string val = toan.TenViet.Trim();
            if (kho.HanThanhToan != 0)
            {
                val = val + " " + LVYModule.Char2Date(kho.NgayThanhToan);
            }
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
                Rpt_HoaDonBanHang hang = new Rpt_HoaDonBanHang();
                try
                {
                    hang.Subreports[0].SetDataSource(dataPrintDK);
                    hang.SetDataSource(dataPrint);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    hang.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    hang.SetParameterValue(2, modGeneral.Tranlated("Email", "") + ": " + modGeneral.H_EMAIL);
                    hang.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    hang.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    hang.SetParameterValue(5, modGeneral.Tranlated("PHIẾU XUẤT H\x00c0NG", ""));
                    hang.SetParameterValue(6, modGeneral.Tranlated("Kh\x00e1ch h\x00e0ng", ""));
                    hang.SetParameterValue(7, modGeneral.Tranlated("Địa chỉ", ""));
                    hang.SetParameterValue(8, modGeneral.Tranlated("Nh\x00e2n vi\x00ean", ""));
                    hang.SetParameterValue(9, modGeneral.Tranlated("M\x00e3 kh\x00e1ch", ""));
                    hang.SetParameterValue(10, modGeneral.Tranlated("Số h\x00f3a đơn", ""));
                    hang.SetParameterValue(11, modGeneral.Tranlated("Số", "") + ": " + kho.SoChungTu.Trim());
                    hang.SetParameterValue(12, modGeneral.Tranlated("T\x00e0i khoản", ""));
                    hang.SetParameterValue(13, modGeneral.Tranlated("STT", ""));
                    hang.SetParameterValue(14, modGeneral.Tranlated("T\x00caN H\x00c0NG", ""));
                    hang.SetParameterValue(15, modGeneral.Tranlated("ĐVT", ""));
                    hang.SetParameterValue(0x10, "Bằng chữ: " + Number2Char(Conversions.ToString(num), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                    hang.SetParameterValue(0x11, modGeneral.Tranlated("M\x00c3 SỐ", ""));
                    hang.SetParameterValue(0x12, modGeneral.Tranlated("SL", ""));
                    hang.SetParameterValue(0x13, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                    hang.SetParameterValue(20, modGeneral.Tranlated("Người giao", ""));
                    hang.SetParameterValue(0x15, modGeneral.Tranlated("Người nhận", ""));
                    hang.SetParameterValue(0x16, modGeneral.Tranlated("Thủ kho", ""));
                    hang.SetParameterValue(0x17, modGeneral.Tranlated("Lập phiếu", ""));
                    hang.SetParameterValue(0x18, modGeneral.Tranlated("Gi\x00e1m đốc", ""));
                    hang.SetParameterValue(0x19, modGeneral.Tranlated("(ghi r\x00f5 họ t\x00ean)", ""));
                    hang.SetParameterValue(0x1a, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                    hang.SetParameterValue(0x1b, modGeneral.Tranlated("Tổng tiền h\x00e0ng", ""));
                    hang.SetParameterValue(0x1c, modGeneral.Tranlated("TIỀN THUẾ", ""));
                    hang.SetParameterValue(0x1d, modGeneral.Tranlated("Ti\x00eàn thanh to\x00e1n", "") + ":");
                    hang.SetParameterValue(30, tuong.DienThoai);
                    hang.SetParameterValue(0x1f, modGeneral.Tranlated("Chiết khấu", ""));
                    hang.SetParameterValue(0x20, LVYModule.DateLetter(LVYModule.Char2Date(kho.NgayChungTu), "VIET"));
                    hang.SetParameterValue(0x21, modGeneral.Tranlated("Tổng thuế", ""));
                    hang.SetParameterValue(0x22, modGeneral.Tranlated("Giao h\x00e0ng tại", ""));
                    if (kho.DienGiaiGiaoHang.Trim() != "")
                    {
                        str = "(" + kho.DienGiaiGiaoHang.Trim() + ")";
                    }
                    if (kho.NguoiGiao.Trim() != "")
                    {
                        object instance = kho.NguoiGiao.Split(new char[] { '|' });
                        if (Information.UBound((Array) instance, 1) == 0)
                        {
                            hang.SetParameterValue(0x23, RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null)));
                        }
                        else
                        {
                            hang.SetParameterValue(0x23, Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null).ToString() + "        ") + modGeneral.Tranlated("Điện thoại", "") + ":", NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null)));
                        }
                    }
                    else
                    {
                        hang.SetParameterValue(0x23, "");
                    }
                    hang.SetParameterValue(0x24, modGeneral.Tranlated("Loại tiền", ""));
                    hang.SetParameterValue(0x25, modGeneral.Tranlated("Tỷ gi\x00e1", ""));
                    hang.SetParameterValue(0x26, modGeneral.Tranlated("Quy đổi", "") + ":");
                    hang.SetParameterValue(0x27, num);
                    hang.SetParameterValue(40, tien.SoLe);
                    hang.SetParameterValue(0x29, kho.TienChietKhauNT);
                    hang.SetParameterValue(0x2a, kho.TienThueVATNT);
                    hang.SetParameterValue(0x2b, modGeneral.Tranlated("Phương thức thanh to\x00e1n", "") + ":");
                    hang.SetParameterValue(0x2c, modGeneral.Tranlated("Nh\x00e2n vi\x00ean b\x00e1n h\x00e0ng", ""));
                    hang.SetParameterValue(0x2d, modGeneral.Tranlated("Người li\x00ean hệ", ""));
                    hang.SetParameterValue(0x2e, val);
                    hang.SetParameterValue(0x2f, modGeneral.Tranlated("SERI", ""));
                    hang.SetParameterValue(0x30, "Website:" + modGeneral.H_WEBSITE);
                    hang.SetParameterValue(0x31, "Email:" + modGeneral.H_EMAIL);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hang;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintHoaDon_Mau(string TenRpt, string strMauHD, string strKiHieu)
        {
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            DefaultValue value2 = new DefaultValue();
            double num6 = 0.0;
            int num5 = 0;
            int num4 = 0;
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            DataTable dataTable = kho.GetDataPrint_Mau(modGeneral.H_SOLIENIN, strMauHD, strKiHieu);
            DataTable dSLien = value2.GetDSLien(modGeneral.H_SOLIENIN);
            int num3 = (int) Math.Round((double) (((double) dataTable.Rows.Count) / ((double) modGeneral.H_SOLIENIN)));
            if (num3 < 9)
            {
                int num7 = dSLien.Rows.Count - 1;
                for (int i = 0; i <= num7; i++)
                {
                    DataRow row;
                    int num8;
                    int num2 = num3;
                    goto Label_019B;
                Label_00C8:
                    row = dataTable.NewRow();
                    row["MaHang"] = " ";
                    row["TenLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenViet"]);
                    row["DienGiaiLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiViet"]);
                    row["TenLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenAnh"]);
                    row["DienGiaiLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiAnh"]);
                    dataTable.Rows.Add(row);
                    num2++;
                Label_019B:
                    num8 = 9;
                    if (num2 <= num8)
                    {
                        goto Label_00C8;
                    }
                }
            }
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else if (TenRpt == "GTGT01")
            {
                Rpt_HoaDonGTGT01_Mau mau = new Rpt_HoaDonGTGT01_Mau();
                try
                {
                    mau.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    mau.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        mau.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        mau.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    mau.SetParameterValue(1, modGeneral.H_ADDRESS);
                    mau.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                    mau.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                    mau.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                    mau.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                    mau.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                    mau.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                    mau.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                    mau.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                    mau.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                    mau.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                    mau.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                    mau.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                    mau.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                    mau.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                    mau.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                    mau.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                    mau.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                    mau.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                    mau.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                    mau.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                    mau.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                    mau.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                    mau.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                    mau.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                    mau.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                    mau.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                    mau.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                    mau.SetParameterValue(30, Number2Char(Conversions.ToString(num6), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                    mau.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                    mau.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                    mau.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                    mau.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                    mau.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                    mau.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(num4), ""));
                    mau.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(num5), ""));
                    mau.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                    mau.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                    mau.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = mau;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
            else if (TenRpt == "GTGT02")
            {
                Rpt_HoaDonGTGT02_Mau mau2 = new Rpt_HoaDonGTGT02_Mau();
                try
                {
                    mau2.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    mau2.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        mau2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        mau2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    mau2.SetParameterValue(1, modGeneral.H_ADDRESS);
                    mau2.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                    mau2.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                    mau2.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                    mau2.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau2.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                    mau2.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                    mau2.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                    mau2.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                    mau2.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                    mau2.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                    mau2.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                    mau2.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                    mau2.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                    mau2.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                    mau2.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau2.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                    mau2.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                    mau2.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                    mau2.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                    mau2.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                    mau2.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                    mau2.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                    mau2.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                    mau2.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                    mau2.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                    mau2.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                    mau2.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                    mau2.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                    mau2.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                    mau2.SetParameterValue(30, Number2Char(Conversions.ToString(num6), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                    mau2.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                    mau2.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                    mau2.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                    mau2.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                    mau2.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                    mau2.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(num4), ""));
                    mau2.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(num5), ""));
                    mau2.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                    mau2.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                    mau2.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                    mau2.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = mau2;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception7)
                {
                    ProjectData.SetProjectError(exception7);
                    Exception exception2 = exception7;
                    MessageBox.Show(exception2.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
            else if (TenRpt == "GTGT03")
            {
                Rpt_HoaDonGTGT03_Mau mau3 = new Rpt_HoaDonGTGT03_Mau();
                try
                {
                    mau3.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    mau3.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        mau3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        mau3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    mau3.SetParameterValue(1, modGeneral.H_ADDRESS);
                    mau3.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                    mau3.SetParameterValue(3, "Điện thoại : " + modGeneral.H_TELEPHONE);
                    mau3.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                    mau3.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau3.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                    mau3.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                    mau3.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                    mau3.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                    mau3.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                    mau3.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                    mau3.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                    mau3.SetParameterValue(12, "Ng\x00e0y " + LVYModule.sRight(kho.NgayHoaDon, 2) + " th\x00e1ng " + LVYModule.sMid(kho.NgayHoaDon, 5, 2) + " năm " + LVYModule.sLeft(kho.NgayHoaDon, 4));
                    mau3.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                    mau3.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                    mau3.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau3.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                    mau3.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                    mau3.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                    mau3.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                    mau3.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                    mau3.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                    mau3.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                    mau3.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                    mau3.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                    mau3.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                    mau3.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                    mau3.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                    mau3.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                    mau3.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                    mau3.SetParameterValue(30, Number2Char(Conversions.ToString(num6), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                    mau3.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                    mau3.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                    mau3.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                    mau3.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                    mau3.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                    mau3.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(num4), ""));
                    mau3.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(num5), ""));
                    mau3.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                    mau3.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                    mau3.SetParameterValue(0x29, "In tại: " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế: " + modGeneral.H_TAXCODE);
                    mau3.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = mau3;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception8)
                {
                    ProjectData.SetProjectError(exception8);
                    Exception exception3 = exception8;
                    MessageBox.Show(exception3.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
            else if (TenRpt == "HDBH01")
            {
                Rpt_HoaDonHDBH01_Mau mau4 = new Rpt_HoaDonHDBH01_Mau();
                try
                {
                    mau4.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    mau4.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        mau4.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        mau4.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    mau4.SetParameterValue(1, modGeneral.H_ADDRESS);
                    mau4.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                    mau4.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                    mau4.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                    mau4.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau4.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                    mau4.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                    mau4.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                    mau4.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                    mau4.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                    mau4.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                    mau4.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                    mau4.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                    mau4.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                    mau4.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                    mau4.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau4.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                    mau4.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                    mau4.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                    mau4.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                    mau4.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                    mau4.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                    mau4.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                    mau4.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                    mau4.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                    mau4.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                    mau4.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                    mau4.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                    mau4.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                    mau4.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                    mau4.SetParameterValue(30, Number2Char(Conversions.ToString(num6), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                    mau4.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                    mau4.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                    mau4.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                    mau4.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                    mau4.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                    mau4.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(num4), ""));
                    mau4.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(num5), ""));
                    mau4.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                    mau4.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                    mau4.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = mau4;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception9)
                {
                    ProjectData.SetProjectError(exception9);
                    Exception exception4 = exception9;
                    MessageBox.Show(exception4.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
            else if (TenRpt == "HDBH02")
            {
                Rpt_HoaDonHDBH02_Mau mau5 = new Rpt_HoaDonHDBH02_Mau();
                try
                {
                    mau5.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    mau5.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        mau5.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        mau5.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    mau5.SetParameterValue(1, modGeneral.H_ADDRESS);
                    mau5.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                    mau5.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                    mau5.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                    mau5.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau5.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                    mau5.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                    mau5.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                    mau5.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                    mau5.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                    mau5.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                    mau5.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                    mau5.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                    mau5.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                    mau5.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                    mau5.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau5.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                    mau5.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                    mau5.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                    mau5.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                    mau5.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                    mau5.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                    mau5.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                    mau5.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                    mau5.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                    mau5.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                    mau5.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                    mau5.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                    mau5.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                    mau5.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                    mau5.SetParameterValue(30, Number2Char(Conversions.ToString(num6), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                    mau5.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                    mau5.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                    mau5.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                    mau5.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                    mau5.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                    mau5.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(num4), ""));
                    mau5.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(num5), ""));
                    mau5.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                    mau5.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                    mau5.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                    mau5.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = mau5;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception10)
                {
                    ProjectData.SetProjectError(exception10);
                    Exception exception5 = exception10;
                    MessageBox.Show(exception5.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
            else if (TenRpt == "HDBH03")
            {
                Rpt_HoaDonHDBH03_Mau mau6 = new Rpt_HoaDonHDBH03_Mau();
                try
                {
                    mau6.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    mau6.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        mau6.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        mau6.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    mau6.SetParameterValue(1, modGeneral.H_ADDRESS);
                    mau6.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                    mau6.SetParameterValue(3, "Điện thoại : " + modGeneral.H_TELEPHONE);
                    mau6.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                    mau6.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau6.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                    mau6.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                    mau6.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                    mau6.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                    mau6.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                    mau6.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                    mau6.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                    mau6.SetParameterValue(12, "Ng\x00e0y ");
                    mau6.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                    mau6.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                    mau6.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    mau6.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                    mau6.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                    mau6.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                    mau6.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                    mau6.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                    mau6.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                    mau6.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                    mau6.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                    mau6.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                    mau6.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                    mau6.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                    mau6.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                    mau6.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                    mau6.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                    mau6.SetParameterValue(30, Number2Char(Conversions.ToString(num6), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                    mau6.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                    mau6.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                    mau6.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                    mau6.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                    mau6.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                    mau6.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(num4), ""));
                    mau6.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(num5), ""));
                    mau6.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                    mau6.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                    mau6.SetParameterValue(0x29, "In tại: " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế: " + modGeneral.H_TAXCODE);
                    mau6.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = mau6;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception11)
                {
                    ProjectData.SetProjectError(exception11);
                    Exception exception6 = exception11;
                    MessageBox.Show(exception6.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintHoaDonDichVu(string strKhoa)
        {
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            double num = 0.0;
            string strTKNo = "";
            string strTKCo = "";
            clsDMLoaiTien tien = new clsDMLoaiTien();
            string str = "";
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            tien.LoadByCode(kho.LoaiTien.Trim());
            num = (kho.TienHang + kho.TienThueVAT) - kho.TienChietKhau;
            num = Math.Round(num, 0);
            DataTable dataPrint = kho.GetDataPrint(strKhoa, "VIET");
            DataTable dataPrintDK = kho.GetDataPrintDK(strKhoa, modGeneral.H_LANGUAGE);
            clsDMPhuongThucThanhToan toan = new clsDMPhuongThucThanhToan();
            toan.Load(kho.KhoaKhoanMuc);
            string val = toan.TenViet.Trim();
            if (kho.HanThanhToan != 0)
            {
                val = val + " " + LVYModule.Char2Date(kho.NgayThanhToan);
            }
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
                Rpt_HoaDonBanHang hang = new Rpt_HoaDonBanHang();
                try
                {
                    hang.Subreports[0].SetDataSource(dataPrintDK);
                    hang.SetDataSource(dataPrint);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    hang.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    hang.SetParameterValue(2, modGeneral.Tranlated("Email", "") + ": " + modGeneral.H_EMAIL);
                    hang.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    hang.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    hang.SetParameterValue(5, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                    hang.SetParameterValue(6, modGeneral.Tranlated("Kh\x00e1ch h\x00e0ng", ""));
                    hang.SetParameterValue(7, modGeneral.Tranlated("Địa chỉ", ""));
                    hang.SetParameterValue(8, modGeneral.Tranlated("Nh\x00e2n vi\x00ean", ""));
                    hang.SetParameterValue(9, modGeneral.Tranlated("M\x00e3 kh\x00e1ch", ""));
                    hang.SetParameterValue(10, modGeneral.Tranlated("Số h\x00f3a đơn", ""));
                    hang.SetParameterValue(11, modGeneral.Tranlated("Số", "") + ": " + kho.SoChungTu.Trim());
                    hang.SetParameterValue(12, modGeneral.Tranlated("Số TK", ""));
                    hang.SetParameterValue(13, modGeneral.Tranlated("STT", ""));
                    hang.SetParameterValue(14, modGeneral.Tranlated("T\x00caN H\x00c0NG", ""));
                    hang.SetParameterValue(15, modGeneral.Tranlated("ĐVT", ""));
                    hang.SetParameterValue(0x10, "Bằng chữ: " + Number2Char(Conversions.ToString(num), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                    hang.SetParameterValue(0x11, modGeneral.Tranlated("M\x00c3 SỐ", ""));
                    hang.SetParameterValue(0x12, modGeneral.Tranlated("SL", ""));
                    hang.SetParameterValue(0x13, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                    hang.SetParameterValue(20, modGeneral.Tranlated("Người giao", ""));
                    hang.SetParameterValue(0x15, modGeneral.Tranlated("Người nhận", ""));
                    hang.SetParameterValue(0x16, modGeneral.Tranlated("Thủ kho", ""));
                    hang.SetParameterValue(0x17, modGeneral.Tranlated("Thủ trưởng", ""));
                    hang.SetParameterValue(0x18, modGeneral.Tranlated("Thủ trưởng đơn vị", ""));
                    hang.SetParameterValue(0x19, modGeneral.Tranlated("(ghi r\x00f5 họ t\x00ean)", ""));
                    hang.SetParameterValue(0x1a, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                    hang.SetParameterValue(0x1b, modGeneral.Tranlated("Tổng tiền h\x00e0ng", ""));
                    hang.SetParameterValue(0x1c, modGeneral.Tranlated("TIỀN THUẾ", ""));
                    hang.SetParameterValue(0x1d, modGeneral.Tranlated("Ti\x00eàn thanh to\x00e1n", "") + ":");
                    hang.SetParameterValue(30, modGeneral.Tranlated("(%)Thuế", ""));
                    hang.SetParameterValue(0x1f, modGeneral.Tranlated("Chiết khấu", ""));
                    hang.SetParameterValue(0x20, LVYModule.DateLetter(LVYModule.Char2Date(kho.NgayChungTu), "VIET"));
                    hang.SetParameterValue(0x21, modGeneral.Tranlated("Tổng thuế", ""));
                    hang.SetParameterValue(0x22, modGeneral.Tranlated("Giao h\x00e0ng tại", ""));
                    if (kho.DienGiaiGiaoHang.Trim() != "")
                    {
                        str = "(" + kho.DienGiaiGiaoHang.Trim() + ")";
                    }
                    hang.SetParameterValue(0x23, kho.DiaChiGiaoHang.Trim() + " " + str);
                    hang.SetParameterValue(0x24, modGeneral.Tranlated("Loại tiền", ""));
                    hang.SetParameterValue(0x25, modGeneral.Tranlated("Tỷ gi\x00e1", ""));
                    hang.SetParameterValue(0x26, modGeneral.Tranlated("Quy đổi", "") + ":");
                    hang.SetParameterValue(0x27, num);
                    hang.SetParameterValue(40, tien.SoLe);
                    hang.SetParameterValue(0x29, kho.TienChietKhauNT);
                    hang.SetParameterValue(0x2a, kho.TienThueVATNT);
                    hang.SetParameterValue(0x2b, modGeneral.Tranlated("Thanh to\x00e1n", ""));
                    hang.SetParameterValue(0x2c, modGeneral.Tranlated("Lập phiếu", ""));
                    hang.SetParameterValue(0x2d, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                    hang.SetParameterValue(0x2e, val);
                    hang.SetParameterValue(0x2f, modGeneral.Tranlated("HẠN D\x00d9NG", ""));
                    hang.PrintToPrinter(1, true, 1, 1);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hang;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintHoaDonHDBH(byte[] BarCode, string strKhoa, string TenRpt, string pTask, string strSelect)
        {
            DataTable dataPrintVAT;
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            DefaultValue value2 = new DefaultValue();
            double a = 0.0;
            int thueSuat = 0;
            int tyLeChietKhau = 0;
            string strTKNo = "";
            string strTKCo = "";
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            a = (kho.TienHang + kho.TienThueVAT) - kho.TienChietKhau;
            a = Math.Round(a);
            thueSuat = kho.ThueSuat;
            tyLeChietKhau = kho.TyLeChietKhau;
            if (pTask == "Preview")
            {
                dataPrintVAT = kho.GetDataPrintVAT_XemThu(strKhoa, modGeneral.H_SOLIENIN, strSelect);
            }
            else
            {
                dataPrintVAT = kho.GetDataPrintVAT(strKhoa, modGeneral.H_SOLIENIN);
            }
            DataTable dataTable = new DataTable();
            DataColumn column = new DataColumn();
            dataTable.Columns.Add(new DataColumn("Image", typeof(byte[])));
            DataRow row2 = dataTable.NewRow();
            row2["Image"] = BarCode;
            dataTable.Rows.Add(row2);
            DataTable dSLien = value2.GetDSLien(modGeneral.H_SOLIENIN);
            int num3 = (int) Math.Round((double) (((double) dataPrintVAT.Rows.Count) / ((double) modGeneral.H_SOLIENIN)));
            if (num3 < 9)
            {
                int num7 = dSLien.Rows.Count - 1;
                for (int i = 0; i <= num7; i++)
                {
                    DataRow row;
                    int num8;
                    int num2 = num3;
                    goto Label_026A;
                Label_0185:
                    row = dataPrintVAT.NewRow();
                    row["MaHang"] = " ";
                    row["TenHang"] = " ";
                    row["TenLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenViet"]);
                    row["DienGiaiLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiViet"]);
                    row["TenLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenAnh"]);
                    row["DienGiaiLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiAnh"]);
                    dataPrintVAT.Rows.Add(row);
                    num2++;
                Label_026A:
                    num8 = 9;
                    if (num2 <= num8)
                    {
                        goto Label_0185;
                    }
                }
            }
            if (dataPrintVAT.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
                if (TenRpt == "HDBH01")
                {
                    Rpt_HoaDonHDBH01 nhdbh = new Rpt_HoaDonHDBH01();
                    try
                    {
                        nhdbh.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        nhdbh.Subreports[0].SetDataSource(dataTable);
                        nhdbh.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            nhdbh.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            nhdbh.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        nhdbh.SetParameterValue(1, modGeneral.H_ADDRESS);
                        nhdbh.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        nhdbh.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        nhdbh.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        nhdbh.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        nhdbh.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        nhdbh.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                        nhdbh.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        nhdbh.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        nhdbh.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        nhdbh.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        nhdbh.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        nhdbh.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        nhdbh.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        nhdbh.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        nhdbh.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        nhdbh.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        nhdbh.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        nhdbh.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        nhdbh.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        nhdbh.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        nhdbh.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        nhdbh.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        nhdbh.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        nhdbh.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        nhdbh.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        nhdbh.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        nhdbh.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        nhdbh.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        nhdbh.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        nhdbh.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        nhdbh.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        nhdbh.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (thueSuat != 0)
                        {
                            nhdbh.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            nhdbh.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        nhdbh.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        nhdbh.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        nhdbh.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        if (pTask == "Preview")
                        {
                            nhdbh.PageHeaderSection1.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = nhdbh;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            nhdbh.PageHeaderSection1.SectionFormat.EnableSuppress = true;
                            nhdbh.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn b\x00e1n h\x00e0ng ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            nhdbh.PageHeaderSection1.SectionFormat.EnableSuppress = false;
                            nhdbh.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn b\x00e1n h\x00e0ng đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "HDBH02")
                {
                    Rpt_HoaDonHDBH02 nhdbh2 = new Rpt_HoaDonHDBH02();
                    try
                    {
                        nhdbh2.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        nhdbh2.Subreports[0].SetDataSource(dataTable);
                        nhdbh2.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            nhdbh2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            nhdbh2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        nhdbh2.SetParameterValue(1, modGeneral.H_ADDRESS);
                        nhdbh2.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        nhdbh2.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        nhdbh2.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        nhdbh2.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh2.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        nhdbh2.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        nhdbh2.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                        nhdbh2.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        nhdbh2.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        nhdbh2.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        nhdbh2.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        nhdbh2.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        nhdbh2.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        nhdbh2.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        nhdbh2.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh2.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        nhdbh2.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        nhdbh2.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        nhdbh2.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        nhdbh2.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        nhdbh2.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        nhdbh2.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        nhdbh2.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        nhdbh2.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        nhdbh2.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        nhdbh2.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        nhdbh2.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        nhdbh2.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        nhdbh2.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        nhdbh2.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        nhdbh2.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        nhdbh2.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        nhdbh2.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh2.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh2.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        nhdbh2.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (thueSuat != 0)
                        {
                            nhdbh2.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            nhdbh2.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        nhdbh2.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        nhdbh2.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        nhdbh2.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        nhdbh2.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            nhdbh2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = nhdbh2;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            nhdbh2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            nhdbh2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn b\x00e1n h\x00e0ng ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            nhdbh2.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            nhdbh2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn b\x00e1n h\x00e0ng đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception4)
                    {
                        ProjectData.SetProjectError(exception4);
                        Exception exception2 = exception4;
                        MessageBox.Show(exception2.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "HDBH03")
                {
                    Rpt_HoaDonHDBH03 nhdbh3 = new Rpt_HoaDonHDBH03();
                    try
                    {
                        nhdbh3.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        nhdbh3.Subreports[0].SetDataSource(dataTable);
                        nhdbh3.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            nhdbh3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            nhdbh3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        nhdbh3.SetParameterValue(1, modGeneral.H_ADDRESS);
                        nhdbh3.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        nhdbh3.SetParameterValue(3, "Điện thoại : " + modGeneral.H_TELEPHONE);
                        nhdbh3.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        nhdbh3.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh3.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        nhdbh3.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        nhdbh3.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                        nhdbh3.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        nhdbh3.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        nhdbh3.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        nhdbh3.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        nhdbh3.SetParameterValue(12, "Ng\x00e0y ");
                        nhdbh3.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        nhdbh3.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        nhdbh3.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh3.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        nhdbh3.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        nhdbh3.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        nhdbh3.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        nhdbh3.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        nhdbh3.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        nhdbh3.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        nhdbh3.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        nhdbh3.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        nhdbh3.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        nhdbh3.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        nhdbh3.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        nhdbh3.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        nhdbh3.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        nhdbh3.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        nhdbh3.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        nhdbh3.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        nhdbh3.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh3.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh3.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        nhdbh3.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (thueSuat != 0)
                        {
                            nhdbh3.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            nhdbh3.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        nhdbh3.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        nhdbh3.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        nhdbh3.SetParameterValue(0x29, "In tại: " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế: " + modGeneral.H_TAXCODE);
                        nhdbh3.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            nhdbh3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = nhdbh3;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            nhdbh3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            nhdbh3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn b\x00e1n h\x00e0ng ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            nhdbh3.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            nhdbh3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn b\x00e1n h\x00e0ng đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception5)
                    {
                        ProjectData.SetProjectError(exception5);
                        Exception exception3 = exception5;
                        MessageBox.Show(exception3.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintHoaDonHDBHDichVu(byte[] BarCode, string strKhoa, string TenRpt, string pTask, string strSelect)
        {
            DataTable dataPrintVATDichVu;
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            DefaultValue value2 = new DefaultValue();
            double a = 0.0;
            int thueSuat = 0;
            int tyLeChietKhau = 0;
            string strTKNo = "";
            string strTKCo = "";
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            a = (kho.TienHang + kho.TienThueVAT) - kho.TienChietKhau;
            a = Math.Round(a);
            thueSuat = kho.ThueSuat;
            tyLeChietKhau = kho.TyLeChietKhau;
            if (pTask == "Preview")
            {
                dataPrintVATDichVu = kho.GetDataPrintVATDichVu_XemThu(strKhoa, modGeneral.H_SOLIENIN, strSelect);
            }
            else
            {
                dataPrintVATDichVu = kho.GetDataPrintVATDichVu(strKhoa, modGeneral.H_SOLIENIN);
            }
            DataTable dataTable = new DataTable();
            DataColumn column = new DataColumn();
            dataTable.Columns.Add(new DataColumn("Image", typeof(byte[])));
            DataRow row2 = dataTable.NewRow();
            row2["Image"] = BarCode;
            dataTable.Rows.Add(row2);
            DataTable dSLien = value2.GetDSLien(modGeneral.H_SOLIENIN);
            int num3 = (int) Math.Round((double) (((double) dataPrintVATDichVu.Rows.Count) / ((double) modGeneral.H_SOLIENIN)));
            if (num3 < 9)
            {
                int num7 = dSLien.Rows.Count - 1;
                for (int i = 0; i <= num7; i++)
                {
                    DataRow row;
                    int num8;
                    int num2 = num3;
                    goto Label_026A;
                Label_0185:
                    row = dataPrintVATDichVu.NewRow();
                    row["MaHang"] = " ";
                    row["TenHang"] = " ";
                    row["TenLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenViet"]);
                    row["DienGiaiLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiViet"]);
                    row["TenLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenAnh"]);
                    row["DienGiaiLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiAnh"]);
                    dataPrintVATDichVu.Rows.Add(row);
                    num2++;
                Label_026A:
                    num8 = 9;
                    if (num2 <= num8)
                    {
                        goto Label_0185;
                    }
                }
            }
            if (dataPrintVATDichVu.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
                if (TenRpt == "HDBH01")
                {
                    Rpt_HoaDonHDBH01 nhdbh = new Rpt_HoaDonHDBH01();
                    try
                    {
                        nhdbh.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        nhdbh.Subreports[0].SetDataSource(dataTable);
                        nhdbh.SetDataSource(dataPrintVATDichVu);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            nhdbh.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            nhdbh.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        nhdbh.SetParameterValue(1, modGeneral.H_ADDRESS);
                        nhdbh.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        nhdbh.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        nhdbh.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        nhdbh.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        nhdbh.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        nhdbh.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                        nhdbh.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        nhdbh.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        nhdbh.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        nhdbh.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        nhdbh.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        nhdbh.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        nhdbh.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        nhdbh.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        nhdbh.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        nhdbh.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        nhdbh.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        nhdbh.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        nhdbh.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        nhdbh.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        nhdbh.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        nhdbh.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        nhdbh.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        nhdbh.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        nhdbh.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        nhdbh.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        nhdbh.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        nhdbh.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        nhdbh.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        nhdbh.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        nhdbh.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        nhdbh.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (thueSuat != 0)
                        {
                            nhdbh.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            nhdbh.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        nhdbh.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        nhdbh.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        nhdbh.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        if (pTask == "Preview")
                        {
                            nhdbh.PageHeaderSection1.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = nhdbh;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            nhdbh.PageHeaderSection1.SectionFormat.EnableSuppress = true;
                            nhdbh.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn b\x00e1n h\x00e0ng ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            nhdbh.PageHeaderSection1.SectionFormat.EnableSuppress = false;
                            nhdbh.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn b\x00e1n h\x00e0ng đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "HDBH02")
                {
                    Rpt_HoaDonHDBH02 nhdbh2 = new Rpt_HoaDonHDBH02();
                    try
                    {
                        nhdbh2.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        nhdbh2.Subreports[0].SetDataSource(dataTable);
                        nhdbh2.SetDataSource(dataPrintVATDichVu);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            nhdbh2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            nhdbh2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        nhdbh2.SetParameterValue(1, modGeneral.H_ADDRESS);
                        nhdbh2.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        nhdbh2.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        nhdbh2.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        nhdbh2.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh2.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        nhdbh2.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        nhdbh2.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                        nhdbh2.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        nhdbh2.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        nhdbh2.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        nhdbh2.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        nhdbh2.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        nhdbh2.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        nhdbh2.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        nhdbh2.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh2.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        nhdbh2.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        nhdbh2.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        nhdbh2.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        nhdbh2.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        nhdbh2.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        nhdbh2.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        nhdbh2.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        nhdbh2.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        nhdbh2.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        nhdbh2.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        nhdbh2.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        nhdbh2.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        nhdbh2.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        nhdbh2.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        nhdbh2.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        nhdbh2.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        nhdbh2.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh2.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh2.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        nhdbh2.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (thueSuat != 0)
                        {
                            nhdbh2.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            nhdbh2.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        nhdbh2.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        nhdbh2.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        nhdbh2.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        nhdbh2.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            nhdbh2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = nhdbh2;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            nhdbh2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            nhdbh2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn b\x00e1n h\x00e0ng ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            nhdbh2.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            nhdbh2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn b\x00e1n h\x00e0ng đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception4)
                    {
                        ProjectData.SetProjectError(exception4);
                        Exception exception2 = exception4;
                        MessageBox.Show(exception2.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "HDBH03")
                {
                    Rpt_HoaDonHDBH03 nhdbh3 = new Rpt_HoaDonHDBH03();
                    try
                    {
                        nhdbh3.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        nhdbh3.Subreports[0].SetDataSource(dataTable);
                        nhdbh3.SetDataSource(dataPrintVATDichVu);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            nhdbh3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            nhdbh3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        nhdbh3.SetParameterValue(1, modGeneral.H_ADDRESS);
                        nhdbh3.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        nhdbh3.SetParameterValue(3, "Điện thoại : " + modGeneral.H_TELEPHONE);
                        nhdbh3.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        nhdbh3.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh3.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        nhdbh3.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        nhdbh3.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                        nhdbh3.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        nhdbh3.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        nhdbh3.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        nhdbh3.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        nhdbh3.SetParameterValue(12, "Ng\x00e0y ");
                        nhdbh3.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        nhdbh3.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        nhdbh3.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh3.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        nhdbh3.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        nhdbh3.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        nhdbh3.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        nhdbh3.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        nhdbh3.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        nhdbh3.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        nhdbh3.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        nhdbh3.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        nhdbh3.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        nhdbh3.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        nhdbh3.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        nhdbh3.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        nhdbh3.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        nhdbh3.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        nhdbh3.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        nhdbh3.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        nhdbh3.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh3.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh3.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        nhdbh3.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (thueSuat != 0)
                        {
                            nhdbh3.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            nhdbh3.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        nhdbh3.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        nhdbh3.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        nhdbh3.SetParameterValue(0x29, "In tại: " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế: " + modGeneral.H_TAXCODE);
                        nhdbh3.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            nhdbh3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = nhdbh3;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            nhdbh3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            nhdbh3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn b\x00e1n h\x00e0ng ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            nhdbh3.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            nhdbh3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn b\x00e1n h\x00e0ng đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception5)
                    {
                        ProjectData.SetProjectError(exception5);
                        Exception exception3 = exception5;
                        MessageBox.Show(exception3.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintHoaDonHDBHTraHang(byte[] BarCode, string strKhoa, string TenRpt, string pTask, string strSelect)
        {
            DataTable dataPrintVAT;
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            DefaultValue value2 = new DefaultValue();
            double a = 0.0;
            int thueSuat = 0;
            int tyLeChietKhau = 0;
            string strTKNo = "";
            string strTKCo = "";
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            a = (kho.TienHang + kho.TienThueVAT) - kho.TienChietKhau;
            a = Math.Round(a);
            thueSuat = kho.ThueSuat;
            tyLeChietKhau = kho.TyLeChietKhau;
            if (pTask == "Preview")
            {
                dataPrintVAT = kho.GetDataPrintVAT_XemThu(strKhoa, modGeneral.H_SOLIENIN, strSelect);
            }
            else
            {
                dataPrintVAT = kho.GetDataPrintVAT(strKhoa, modGeneral.H_SOLIENIN);
            }
            DataTable dataTable = new DataTable();
            DataColumn column = new DataColumn();
            dataTable.Columns.Add(new DataColumn("Image", typeof(byte[])));
            DataRow row2 = dataTable.NewRow();
            row2["Image"] = BarCode;
            dataTable.Rows.Add(row2);
            DataTable dSLien = value2.GetDSLien(modGeneral.H_SOLIENIN);
            int num3 = (int) Math.Round((double) (((double) dataPrintVAT.Rows.Count) / ((double) modGeneral.H_SOLIENIN)));
            if (num3 < 9)
            {
                int num7 = dSLien.Rows.Count - 1;
                for (int i = 0; i <= num7; i++)
                {
                    int num8;
                    DataRow row = dataPrintVAT.NewRow();
                    row["MaHang"] = "";
                    row["TenHang"] = "Xuất trả lại cho người b\x00e1n";
                    row["TenLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenViet"]);
                    row["DienGiaiLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiViet"]);
                    row["TenLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenAnh"]);
                    row["DienGiaiLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiAnh"]);
                    dataPrintVAT.Rows.Add(row);
                    int num2 = num3 + 1;
                    goto Label_034C;
                Label_0267:
                    row = dataPrintVAT.NewRow();
                    row["MaHang"] = " ";
                    row["TenHang"] = " ";
                    row["TenLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenViet"]);
                    row["DienGiaiLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiViet"]);
                    row["TenLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenAnh"]);
                    row["DienGiaiLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiAnh"]);
                    dataPrintVAT.Rows.Add(row);
                    num2++;
                Label_034C:
                    num8 = 9;
                    if (num2 <= num8)
                    {
                        goto Label_0267;
                    }
                }
            }
            if (dataPrintVAT.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
                if (TenRpt == "HDBH01")
                {
                    Rpt_HoaDonHDBH01 nhdbh = new Rpt_HoaDonHDBH01();
                    try
                    {
                        nhdbh.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        nhdbh.Subreports[0].SetDataSource(dataTable);
                        nhdbh.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            nhdbh.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            nhdbh.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        nhdbh.SetParameterValue(1, modGeneral.H_ADDRESS);
                        nhdbh.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        nhdbh.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        nhdbh.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        nhdbh.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        nhdbh.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        nhdbh.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                        nhdbh.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        nhdbh.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        nhdbh.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        nhdbh.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        nhdbh.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        nhdbh.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        nhdbh.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        nhdbh.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        nhdbh.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        nhdbh.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        nhdbh.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        nhdbh.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        nhdbh.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        nhdbh.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        nhdbh.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        nhdbh.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        nhdbh.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        nhdbh.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        nhdbh.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        nhdbh.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        nhdbh.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        nhdbh.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        nhdbh.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        nhdbh.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        nhdbh.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        nhdbh.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (thueSuat != 0)
                        {
                            nhdbh.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            nhdbh.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        nhdbh.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        nhdbh.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        nhdbh.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        if (pTask == "Preview")
                        {
                            nhdbh.PageHeaderSection1.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = nhdbh;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            nhdbh.PageHeaderSection1.SectionFormat.EnableSuppress = true;
                            nhdbh.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn b\x00e1n h\x00e0ng ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            nhdbh.PageHeaderSection1.SectionFormat.EnableSuppress = false;
                            nhdbh.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn b\x00e1n h\x00e0ng đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "HDBH02")
                {
                    Rpt_HoaDonHDBH02 nhdbh2 = new Rpt_HoaDonHDBH02();
                    try
                    {
                        nhdbh2.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        nhdbh2.Subreports[0].SetDataSource(dataTable);
                        nhdbh2.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            nhdbh2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            nhdbh2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        nhdbh2.SetParameterValue(1, modGeneral.H_ADDRESS);
                        nhdbh2.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        nhdbh2.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        nhdbh2.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        nhdbh2.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh2.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        nhdbh2.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        nhdbh2.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                        nhdbh2.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        nhdbh2.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        nhdbh2.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        nhdbh2.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        nhdbh2.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        nhdbh2.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        nhdbh2.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        nhdbh2.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh2.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        nhdbh2.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        nhdbh2.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        nhdbh2.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        nhdbh2.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        nhdbh2.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        nhdbh2.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        nhdbh2.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        nhdbh2.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        nhdbh2.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        nhdbh2.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        nhdbh2.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        nhdbh2.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        nhdbh2.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        nhdbh2.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        nhdbh2.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        nhdbh2.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        nhdbh2.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh2.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh2.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        nhdbh2.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (thueSuat != 0)
                        {
                            nhdbh2.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            nhdbh2.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        nhdbh2.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        nhdbh2.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        nhdbh2.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        nhdbh2.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            nhdbh2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = nhdbh2;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            nhdbh2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            nhdbh2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn b\x00e1n h\x00e0ng ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            nhdbh2.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            nhdbh2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn b\x00e1n h\x00e0ng đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception4)
                    {
                        ProjectData.SetProjectError(exception4);
                        Exception exception2 = exception4;
                        MessageBox.Show(exception2.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "HDBH03")
                {
                    Rpt_HoaDonHDBH03 nhdbh3 = new Rpt_HoaDonHDBH03();
                    try
                    {
                        nhdbh3.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        nhdbh3.Subreports[0].SetDataSource(dataTable);
                        nhdbh3.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            nhdbh3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            nhdbh3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        nhdbh3.SetParameterValue(1, modGeneral.H_ADDRESS);
                        nhdbh3.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        nhdbh3.SetParameterValue(3, "Điện thoại : " + modGeneral.H_TELEPHONE);
                        nhdbh3.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        nhdbh3.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh3.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        nhdbh3.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        nhdbh3.SetParameterValue(0x23, modGeneral.Tranlated("H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                        nhdbh3.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        nhdbh3.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        nhdbh3.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        nhdbh3.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        nhdbh3.SetParameterValue(12, "Ng\x00e0y ");
                        nhdbh3.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        nhdbh3.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        nhdbh3.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        nhdbh3.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        nhdbh3.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        nhdbh3.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        nhdbh3.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        nhdbh3.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        nhdbh3.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        nhdbh3.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        nhdbh3.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        nhdbh3.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        nhdbh3.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        nhdbh3.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        nhdbh3.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        nhdbh3.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        nhdbh3.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        nhdbh3.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        nhdbh3.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        nhdbh3.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        nhdbh3.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh3.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        nhdbh3.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        nhdbh3.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (thueSuat != 0)
                        {
                            nhdbh3.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            nhdbh3.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        nhdbh3.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        nhdbh3.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        nhdbh3.SetParameterValue(0x29, "In tại: " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế: " + modGeneral.H_TAXCODE);
                        nhdbh3.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            nhdbh3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = nhdbh3;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            nhdbh3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            nhdbh3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn b\x00e1n h\x00e0ng ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            nhdbh3.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            nhdbh3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn b\x00e1n h\x00e0ng đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception5)
                    {
                        ProjectData.SetProjectError(exception5);
                        Exception exception3 = exception5;
                        MessageBox.Show(exception3.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintHoaDonMuaDichVu(string strKhoa)
        {
            clsNhapKho kho = new clsNhapKho();
            string strTKNo = "";
            string strTKCo = "";
            double num = 0.0;
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            num = (kho.TienHang + kho.TienThueNhapKhau) + kho.TienThueVAT;
            kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            DataTable dataPrintDichVu = kho.GetDataPrintDichVu(strKhoa);
            if (dataPrintDichVu != null)
            {
                if (dataPrintDichVu.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
                }
                else
                {
                    object instance = new Rpt_NhapKho();
                    try
                    {
                        object[] arguments = new object[] { dataPrintDichVu };
                        bool[] copyBack = new bool[] { true };
                        NewLateBinding.LateCall(instance, null, "SetDataSource", arguments, null, null, copyBack, true);
                        if (copyBack[0])
                        {
                            dataPrintDichVu = (DataTable) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(DataTable));
                        }
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, "") }, null, null, null, true);
                        }
                        else
                        {
                            NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, "") }, null, null, null, true);
                        }
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 5, modGeneral.Tranlated("H\x00d3A ĐƠN MUA H\x00c0NG", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 6, LVYModule.Date2Letter(LVYModule.Char2Date(kho.NgayChungTu)) }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 7, modGeneral.Tranlated("Số chứng từ", "") + ": " + kho.SoChungTu }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 8, modGeneral.Tranlated("Tiền h\x00e0ng", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 9, modGeneral.Tranlated("Nh\x00e0 cung cấp", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 10, modGeneral.Tranlated("Người giao", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 11, modGeneral.Tranlated("M\x00f4 tả", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 12, modGeneral.Tranlated("K\x00fd hiệu", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 13, modGeneral.Tranlated("Số h\x00f3a đơn", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 14, modGeneral.Tranlated("Ng\x00e0y", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 15, modGeneral.Tranlated("Tổng số tiền", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x10, modGeneral.Tranlated("Số chứng từ gốc k\x00e8m theo", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x11, modGeneral.Tranlated("Người lập phiếu", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x12, modGeneral.Tranlated("Người giao h\x00e0ng", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x13, modGeneral.Tranlated("Thủ kho", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 20, modGeneral.Tranlated("Gi\x00e1m đốc", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x15, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x16, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x17, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x18, modGeneral.Tranlated("STT", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x19, modGeneral.Tranlated("T\x00ean, nh\x00e3n hiệu, quy c\x00e1ch phẩm chất vật tư h\x00e0ng h\x00f3a", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x1a, modGeneral.Tranlated("M\x00e3 số", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x1b, modGeneral.Tranlated("ĐVT", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x1c, modGeneral.Tranlated("Số lượng", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x1d, modGeneral.Tranlated("Đơn gi\x00e1", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 30, modGeneral.Tranlated("Th\x00e0nh tiền", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x1f, modGeneral.Tranlated("Thuế nhập khẩu", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x20, modGeneral.Tranlated("Tiền thuế", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x21, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", "") }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x22, modGeneral.Tranlated("Bằng chữ", "") + ": " + Number2Char(Conversions.ToString(num), ".") + " (VND)" }, null, null, null, true);
                        NewLateBinding.LateCall(instance, null, "SetParameterValue", new object[] { 0x23, modGeneral.Tranlated("Tổng cộng", "") + ":" }, null, null, null, true);
                        MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = RuntimeHelpers.GetObjectValue(instance);
                        MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                        MyProject.Forms.Frm_ViewReport.ShowDialog();
                        if (Form.ActiveForm != null)
                        {
                            Form.ActiveForm.Cursor = Cursors.Default;
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        if (Form.ActiveForm != null)
                        {
                            Form.ActiveForm.Cursor = Cursors.Default;
                        }
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintHoaDonVAT(byte[] BarCode, string strKhoa, string TenRpt, string pTask, string strSelect)
        {
            DataTable dataPrintVAT;
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            DefaultValue value2 = new DefaultValue();
            clsDMLoaiHoaDon don = new clsDMLoaiHoaDon();
            string str2 = "";
            double a = 0.0;
            int thueSuat = 0;
            int tyLeChietKhau = 0;
            string strTKNo = "";
            string strTKCo = "";
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            a = (kho.TienHang + kho.TienThueVAT) - kho.TienChietKhau;
            a = Math.Round(a);
            thueSuat = kho.ThueSuat;
            tyLeChietKhau = kho.TyLeChietKhau;
            don.Load(kho.KhoaLoaiHoaDon);
            str2 = don.Ma.Trim();
            if (pTask == "Preview")
            {
                dataPrintVAT = kho.GetDataPrintVAT_XemThu(strKhoa, modGeneral.H_SOLIENIN, strSelect);
            }
            else
            {
                dataPrintVAT = kho.GetDataPrintVAT(strKhoa, modGeneral.H_SOLIENIN);
            }
            DataTable dataTable = new DataTable();
            DataColumn column = new DataColumn();
            dataTable.Columns.Add(new DataColumn("Image", typeof(byte[])));
            DataRow row2 = dataTable.NewRow();
            row2["Image"] = BarCode;
            dataTable.Rows.Add(row2);
            DataTable dSLien = value2.GetDSLien(modGeneral.H_SOLIENIN);
            int num3 = (int) Math.Round((double) (((double) dataPrintVAT.Rows.Count) / ((double) modGeneral.H_SOLIENIN)));
            if (num3 < 9)
            {
                int num7 = dSLien.Rows.Count - 1;
                for (int i = 0; i <= num7; i++)
                {
                    DataRow row;
                    int num8;
                    int num2 = num3;
                    goto Label_0296;
                Label_01AF:
                    row = dataPrintVAT.NewRow();
                    row["MaHang"] = " ";
                    row["TenHang"] = " ";
                    row["TenLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenViet"]);
                    row["DienGiaiLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiViet"]);
                    row["TenLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenAnh"]);
                    row["DienGiaiLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiAnh"]);
                    dataPrintVAT.Rows.Add(row);
                    num2++;
                Label_0296:
                    num8 = 9;
                    if (num2 <= num8)
                    {
                        goto Label_01AF;
                    }
                }
            }
            if (dataPrintVAT.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
                if (TenRpt == "GTGT01")
                {
                    Rpt_HoaDonGTGT01 ngtgt = new Rpt_HoaDonGTGT01();
                    try
                    {
                        ngtgt.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        ngtgt.Subreports[0].SetDataSource(dataTable);
                        ngtgt.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            ngtgt.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            ngtgt.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        ngtgt.SetParameterValue(1, modGeneral.H_ADDRESS);
                        ngtgt.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        ngtgt.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        ngtgt.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        ngtgt.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        ngtgt.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        ngtgt.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                        ngtgt.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        ngtgt.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        ngtgt.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        ngtgt.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        ngtgt.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        ngtgt.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        ngtgt.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        ngtgt.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        ngtgt.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        ngtgt.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        ngtgt.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        ngtgt.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        ngtgt.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        ngtgt.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        ngtgt.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        ngtgt.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        ngtgt.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        ngtgt.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        ngtgt.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        ngtgt.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        ngtgt.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        ngtgt.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        ngtgt.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        ngtgt.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        ngtgt.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        ngtgt.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (str2 != "VWVBRTT")
                        {
                            ngtgt.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            ngtgt.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        ngtgt.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        ngtgt.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        ngtgt.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        if (pTask == "Preview")
                        {
                            ngtgt.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ngtgt;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            ngtgt.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            ngtgt.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn GTGT ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            ngtgt.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            ngtgt.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn GTGT đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "GTGT02")
                {
                    Rpt_HoaDonGTGT02 ngtgt2 = new Rpt_HoaDonGTGT02();
                    try
                    {
                        ngtgt2.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        ngtgt2.Subreports[0].SetDataSource(dataTable);
                        ngtgt2.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            ngtgt2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            ngtgt2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        ngtgt2.SetParameterValue(1, modGeneral.H_ADDRESS);
                        ngtgt2.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        ngtgt2.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        ngtgt2.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        ngtgt2.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt2.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        ngtgt2.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        ngtgt2.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                        ngtgt2.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        ngtgt2.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        ngtgt2.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        ngtgt2.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        ngtgt2.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        ngtgt2.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        ngtgt2.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        ngtgt2.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt2.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        ngtgt2.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        ngtgt2.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        ngtgt2.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        ngtgt2.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        ngtgt2.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        ngtgt2.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        ngtgt2.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        ngtgt2.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        ngtgt2.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        ngtgt2.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        ngtgt2.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        ngtgt2.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        ngtgt2.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        ngtgt2.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        ngtgt2.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        ngtgt2.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        ngtgt2.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt2.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt2.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        ngtgt2.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (str2 != "VWVBRTT")
                        {
                            ngtgt2.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            ngtgt2.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        ngtgt2.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        ngtgt2.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        ngtgt2.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        ngtgt2.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            ngtgt2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ngtgt2;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            ngtgt2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            ngtgt2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn GTGT ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            ngtgt2.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            ngtgt2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn GTGT đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception4)
                    {
                        ProjectData.SetProjectError(exception4);
                        Exception exception2 = exception4;
                        MessageBox.Show(exception2.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "GTGT03")
                {
                    Rpt_HoaDonGTGT03 ngtgt3 = new Rpt_HoaDonGTGT03();
                    try
                    {
                        ngtgt3.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        ngtgt3.Subreports[0].SetDataSource(dataTable);
                        ngtgt3.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            ngtgt3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            ngtgt3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        ngtgt3.SetParameterValue(1, modGeneral.H_ADDRESS);
                        ngtgt3.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        ngtgt3.SetParameterValue(3, "Điện thoại : " + modGeneral.H_TELEPHONE);
                        ngtgt3.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        ngtgt3.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt3.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        ngtgt3.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        ngtgt3.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                        ngtgt3.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        ngtgt3.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        ngtgt3.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        ngtgt3.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        ngtgt3.SetParameterValue(12, "Ng\x00e0y " + LVYModule.sRight(kho.NgayHoaDon, 2) + " th\x00e1ng " + LVYModule.sMid(kho.NgayHoaDon, 5, 2) + " năm " + LVYModule.sLeft(kho.NgayHoaDon, 4));
                        ngtgt3.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        ngtgt3.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        ngtgt3.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt3.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        ngtgt3.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        ngtgt3.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        ngtgt3.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        ngtgt3.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        ngtgt3.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        ngtgt3.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        ngtgt3.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        ngtgt3.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        ngtgt3.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        ngtgt3.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        ngtgt3.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        ngtgt3.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        ngtgt3.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        ngtgt3.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        ngtgt3.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        ngtgt3.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        ngtgt3.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt3.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt3.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        ngtgt3.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (str2 != "VWVBRTT")
                        {
                            ngtgt3.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            ngtgt3.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        ngtgt3.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        ngtgt3.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        ngtgt3.SetParameterValue(0x29, "In tại: " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế: " + modGeneral.H_TAXCODE);
                        ngtgt3.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            ngtgt3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ngtgt3;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            ngtgt3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            ngtgt3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn GTGT ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            ngtgt3.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            ngtgt3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn GTGT đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception5)
                    {
                        ProjectData.SetProjectError(exception5);
                        Exception exception3 = exception5;
                        MessageBox.Show(exception3.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintHoaDonVATDichVu(byte[] BarCode, string strKhoa, string TenRpt, string pTask, string strSelect)
        {
            DataTable dataPrintVATDichVu;
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            DefaultValue value2 = new DefaultValue();
            clsDMLoaiHoaDon don = new clsDMLoaiHoaDon();
            string str2 = "";
            double a = 0.0;
            int thueSuat = 0;
            int tyLeChietKhau = 0;
            string strTKNo = "";
            string strTKCo = "";
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            a = (kho.TienHang + kho.TienThueVAT) - kho.TienChietKhau;
            a = Math.Round(a);
            thueSuat = kho.ThueSuat;
            tyLeChietKhau = kho.TyLeChietKhau;
            don.Load(kho.KhoaLoaiHoaDon);
            str2 = don.Ma.Trim();
            if (pTask == "Preview")
            {
                dataPrintVATDichVu = kho.GetDataPrintVATDichVu_XemThu(strKhoa, modGeneral.H_SOLIENIN, strSelect);
            }
            else
            {
                dataPrintVATDichVu = kho.GetDataPrintVATDichVu(strKhoa, modGeneral.H_SOLIENIN);
            }
            DataTable dataTable = new DataTable();
            DataColumn column = new DataColumn();
            dataTable.Columns.Add(new DataColumn("Image", typeof(byte[])));
            DataRow row2 = dataTable.NewRow();
            row2["Image"] = BarCode;
            dataTable.Rows.Add(row2);
            DataTable dSLien = value2.GetDSLien(modGeneral.H_SOLIENIN);
            int num3 = (int) Math.Round((double) (((double) dataPrintVATDichVu.Rows.Count) / ((double) modGeneral.H_SOLIENIN)));
            if (num3 < 9)
            {
                int num7 = dSLien.Rows.Count - 1;
                for (int i = 0; i <= num7; i++)
                {
                    DataRow row;
                    int num8;
                    int num2 = num3;
                    goto Label_0296;
                Label_01AF:
                    row = dataPrintVATDichVu.NewRow();
                    row["MaHang"] = " ";
                    row["TenHang"] = " ";
                    row["TenLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenViet"]);
                    row["DienGiaiLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiViet"]);
                    row["TenLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenAnh"]);
                    row["DienGiaiLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiAnh"]);
                    dataPrintVATDichVu.Rows.Add(row);
                    num2++;
                Label_0296:
                    num8 = 9;
                    if (num2 <= num8)
                    {
                        goto Label_01AF;
                    }
                }
            }
            if (dataPrintVATDichVu.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
                if (TenRpt == "GTGT01")
                {
                    Rpt_HoaDonGTGT01 ngtgt = new Rpt_HoaDonGTGT01();
                    try
                    {
                        ngtgt.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        ngtgt.Subreports[0].SetDataSource(dataTable);
                        ngtgt.SetDataSource(dataPrintVATDichVu);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            ngtgt.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            ngtgt.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        ngtgt.SetParameterValue(1, modGeneral.H_ADDRESS);
                        ngtgt.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        ngtgt.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        ngtgt.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        ngtgt.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        ngtgt.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        ngtgt.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                        ngtgt.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        ngtgt.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        ngtgt.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        ngtgt.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        ngtgt.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        ngtgt.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        ngtgt.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        ngtgt.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        ngtgt.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        ngtgt.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        ngtgt.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        ngtgt.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        ngtgt.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        ngtgt.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        ngtgt.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        ngtgt.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        ngtgt.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        ngtgt.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        ngtgt.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        ngtgt.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        ngtgt.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        ngtgt.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        ngtgt.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        ngtgt.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        ngtgt.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        ngtgt.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (str2 != "VWVBRTT")
                        {
                            ngtgt.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            ngtgt.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        ngtgt.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        ngtgt.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        ngtgt.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        if (pTask == "Preview")
                        {
                            ngtgt.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ngtgt;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            ngtgt.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            ngtgt.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn GTGT ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            ngtgt.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            ngtgt.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn GTGT đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "GTGT02")
                {
                    Rpt_HoaDonGTGT02 ngtgt2 = new Rpt_HoaDonGTGT02();
                    try
                    {
                        ngtgt2.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        ngtgt2.Subreports[0].SetDataSource(dataTable);
                        ngtgt2.SetDataSource(dataPrintVATDichVu);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            ngtgt2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            ngtgt2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        ngtgt2.SetParameterValue(1, modGeneral.H_ADDRESS);
                        ngtgt2.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        ngtgt2.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        ngtgt2.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        ngtgt2.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt2.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        ngtgt2.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        ngtgt2.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                        ngtgt2.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        ngtgt2.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        ngtgt2.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        ngtgt2.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        ngtgt2.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        ngtgt2.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        ngtgt2.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        ngtgt2.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt2.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        ngtgt2.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        ngtgt2.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        ngtgt2.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        ngtgt2.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        ngtgt2.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        ngtgt2.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        ngtgt2.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        ngtgt2.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        ngtgt2.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        ngtgt2.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        ngtgt2.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        ngtgt2.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        ngtgt2.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        ngtgt2.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        ngtgt2.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        ngtgt2.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        ngtgt2.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt2.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt2.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        ngtgt2.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (str2 != "VWVBRTT")
                        {
                            ngtgt2.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            ngtgt2.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        ngtgt2.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        ngtgt2.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        ngtgt2.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        ngtgt2.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            ngtgt2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ngtgt2;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            ngtgt2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            ngtgt2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn GTGT ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            ngtgt2.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            ngtgt2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn GTGT đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception4)
                    {
                        ProjectData.SetProjectError(exception4);
                        Exception exception2 = exception4;
                        MessageBox.Show(exception2.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "GTGT03")
                {
                    Rpt_HoaDonGTGT03 ngtgt3 = new Rpt_HoaDonGTGT03();
                    try
                    {
                        ngtgt3.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        ngtgt3.Subreports[0].SetDataSource(dataTable);
                        ngtgt3.SetDataSource(dataPrintVATDichVu);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            ngtgt3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            ngtgt3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        ngtgt3.SetParameterValue(1, modGeneral.H_ADDRESS);
                        ngtgt3.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        ngtgt3.SetParameterValue(3, "Điện thoại : " + modGeneral.H_TELEPHONE);
                        ngtgt3.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        ngtgt3.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt3.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        ngtgt3.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        ngtgt3.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                        ngtgt3.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        ngtgt3.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        ngtgt3.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        ngtgt3.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        ngtgt3.SetParameterValue(12, "Ng\x00e0y " + LVYModule.sRight(kho.NgayHoaDon, 2) + " th\x00e1ng " + LVYModule.sMid(kho.NgayHoaDon, 5, 2) + " năm " + LVYModule.sLeft(kho.NgayHoaDon, 4));
                        ngtgt3.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        ngtgt3.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        ngtgt3.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt3.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        ngtgt3.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        ngtgt3.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        ngtgt3.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        ngtgt3.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        ngtgt3.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        ngtgt3.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        ngtgt3.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        ngtgt3.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        ngtgt3.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        ngtgt3.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        ngtgt3.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        ngtgt3.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        ngtgt3.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        ngtgt3.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        ngtgt3.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        ngtgt3.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        ngtgt3.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt3.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt3.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        ngtgt3.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (str2 != "VWVBRTT")
                        {
                            ngtgt3.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            ngtgt3.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        ngtgt3.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        ngtgt3.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        ngtgt3.SetParameterValue(0x29, "In tại: " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế: " + modGeneral.H_TAXCODE);
                        ngtgt3.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            ngtgt3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ngtgt3;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            ngtgt3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            ngtgt3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn GTGT ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            ngtgt3.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            ngtgt3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn GTGT đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception5)
                    {
                        ProjectData.SetProjectError(exception5);
                        Exception exception3 = exception5;
                        MessageBox.Show(exception3.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintHoaDonVATTraHang(byte[] BarCode, string strKhoa, string TenRpt, string pTask, string strSelect)
        {
            DataTable dataPrintVAT;
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            DefaultValue value2 = new DefaultValue();
            clsDMLoaiHoaDon don = new clsDMLoaiHoaDon();
            string str2 = "";
            double a = 0.0;
            int thueSuat = 0;
            int tyLeChietKhau = 0;
            string strTKNo = "";
            string strTKCo = "";
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            a = (kho.TienHang + kho.TienThueVAT) - kho.TienChietKhau;
            a = Math.Round(a);
            thueSuat = kho.ThueSuat;
            tyLeChietKhau = kho.TyLeChietKhau;
            don.Load(kho.KhoaLoaiHoaDon);
            str2 = don.Ma.Trim();
            if (pTask == "Preview")
            {
                dataPrintVAT = kho.GetDataPrintVAT_XemThu(strKhoa, modGeneral.H_SOLIENIN, strSelect);
            }
            else
            {
                dataPrintVAT = kho.GetDataPrintVAT(strKhoa, modGeneral.H_SOLIENIN);
            }
            DataTable dataTable = new DataTable();
            DataColumn column = new DataColumn();
            dataTable.Columns.Add(new DataColumn("Image", typeof(byte[])));
            DataRow row2 = dataTable.NewRow();
            row2["Image"] = BarCode;
            dataTable.Rows.Add(row2);
            DataTable dSLien = value2.GetDSLien(modGeneral.H_SOLIENIN);
            int num3 = (int) Math.Round((double) (((double) dataPrintVAT.Rows.Count) / ((double) modGeneral.H_SOLIENIN)));
            if (num3 < 9)
            {
                int num7 = dSLien.Rows.Count - 1;
                for (int i = 0; i <= num7; i++)
                {
                    int num8;
                    DataRow row = dataPrintVAT.NewRow();
                    row["MaHang"] = "";
                    row["TenHang"] = "Xuất trả lại cho người b\x00e1n";
                    row["TenLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenViet"]);
                    row["DienGiaiLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiViet"]);
                    row["TenLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenAnh"]);
                    row["DienGiaiLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiAnh"]);
                    dataPrintVAT.Rows.Add(row);
                    int num2 = num3 + 1;
                    goto Label_0378;
                Label_0291:
                    row = dataPrintVAT.NewRow();
                    row["MaHang"] = " ";
                    row["TenHang"] = " ";
                    row["TenLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenViet"]);
                    row["DienGiaiLienViet"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiViet"]);
                    row["TenLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["TenAnh"]);
                    row["DienGiaiLienAnh"] = RuntimeHelpers.GetObjectValue(dSLien.Rows[i]["DienGiaiAnh"]);
                    dataPrintVAT.Rows.Add(row);
                    num2++;
                Label_0378:
                    num8 = 9;
                    if (num2 <= num8)
                    {
                        goto Label_0291;
                    }
                }
            }
            if (dataPrintVAT.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
                if (TenRpt == "GTGT01")
                {
                    Rpt_HoaDonGTGT01 ngtgt = new Rpt_HoaDonGTGT01();
                    try
                    {
                        ngtgt.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        ngtgt.Subreports[0].SetDataSource(dataTable);
                        ngtgt.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            ngtgt.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            ngtgt.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        ngtgt.SetParameterValue(1, modGeneral.H_ADDRESS);
                        ngtgt.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        ngtgt.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        ngtgt.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        ngtgt.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        ngtgt.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        ngtgt.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                        ngtgt.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        ngtgt.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        ngtgt.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        ngtgt.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        ngtgt.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        ngtgt.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        ngtgt.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        ngtgt.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        ngtgt.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        ngtgt.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        ngtgt.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        ngtgt.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        ngtgt.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        ngtgt.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        ngtgt.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        ngtgt.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        ngtgt.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        ngtgt.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        ngtgt.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        ngtgt.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        ngtgt.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        ngtgt.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        ngtgt.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        ngtgt.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        ngtgt.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        ngtgt.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (str2 != "VWVBRTT")
                        {
                            ngtgt.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            ngtgt.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        ngtgt.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        ngtgt.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        ngtgt.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        if (pTask == "Preview")
                        {
                            ngtgt.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ngtgt;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            ngtgt.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            ngtgt.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn GTGT ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            ngtgt.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            ngtgt.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn GTGT đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "GTGT02")
                {
                    Rpt_HoaDonGTGT02 ngtgt2 = new Rpt_HoaDonGTGT02();
                    try
                    {
                        ngtgt2.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        ngtgt2.Subreports[0].SetDataSource(dataTable);
                        ngtgt2.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            ngtgt2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            ngtgt2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        ngtgt2.SetParameterValue(1, modGeneral.H_ADDRESS);
                        ngtgt2.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        ngtgt2.SetParameterValue(3, "Điện thoại (Tel): " + modGeneral.H_TELEPHONE + " - Fax: " + modGeneral.H_FAX);
                        ngtgt2.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        ngtgt2.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt2.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        ngtgt2.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        ngtgt2.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                        ngtgt2.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        ngtgt2.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        ngtgt2.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        ngtgt2.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        ngtgt2.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        ngtgt2.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        ngtgt2.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        ngtgt2.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt2.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        ngtgt2.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        ngtgt2.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        ngtgt2.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        ngtgt2.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        ngtgt2.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        ngtgt2.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        ngtgt2.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        ngtgt2.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        ngtgt2.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        ngtgt2.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        ngtgt2.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        ngtgt2.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        ngtgt2.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        ngtgt2.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        ngtgt2.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        ngtgt2.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        ngtgt2.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt2.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt2.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        ngtgt2.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (str2 != "VWVBRTT")
                        {
                            ngtgt2.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            ngtgt2.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        ngtgt2.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        ngtgt2.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        ngtgt2.SetParameterValue(0x29, "In tại (Printing by): " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế (Taxcode): " + modGeneral.H_TAXCODE);
                        ngtgt2.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            ngtgt2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ngtgt2;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            ngtgt2.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            ngtgt2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn GTGT ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            ngtgt2.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            ngtgt2.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn GTGT đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception4)
                    {
                        ProjectData.SetProjectError(exception4);
                        Exception exception2 = exception4;
                        MessageBox.Show(exception2.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
                else if (TenRpt == "GTGT03")
                {
                    Rpt_HoaDonGTGT03 ngtgt3 = new Rpt_HoaDonGTGT03();
                    try
                    {
                        ngtgt3.Subreports[1].SetDataSource(modGeneral.H_DATACOMPANY);
                        ngtgt3.Subreports[0].SetDataSource(dataTable);
                        ngtgt3.SetDataSource(dataPrintVAT);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            ngtgt3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            ngtgt3.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        ngtgt3.SetParameterValue(1, modGeneral.H_ADDRESS);
                        ngtgt3.SetParameterValue(2, modGeneral.Tranlated("Website", "") + ": " + modGeneral.H_WEBSITE);
                        ngtgt3.SetParameterValue(3, "Điện thoại : " + modGeneral.H_TELEPHONE);
                        ngtgt3.SetParameterValue(4, modGeneral.Tranlated("Fax: ", "") + " " + modGeneral.H_FAX);
                        ngtgt3.SetParameterValue(5, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt3.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        ngtgt3.SetParameterValue(7, modGeneral.Tranlated("H\x00d3A ĐƠN", ""));
                        ngtgt3.SetParameterValue(0x23, modGeneral.Tranlated("GI\x00c1 TRỊ GIA TĂNG", ""));
                        ngtgt3.SetParameterValue(8, modGeneral.Tranlated("Li\x00ean 1: Lưu", ""));
                        ngtgt3.SetParameterValue(9, modGeneral.Tranlated("Mẫu số", ""));
                        ngtgt3.SetParameterValue(10, modGeneral.Tranlated("K\x00fd hiệu", ""));
                        ngtgt3.SetParameterValue(11, modGeneral.Tranlated("Số", ""));
                        ngtgt3.SetParameterValue(12, "Ng\x00e0y " + LVYModule.sRight(kho.NgayHoaDon, 2) + " th\x00e1ng " + LVYModule.sMid(kho.NgayHoaDon, 5, 2) + " năm " + LVYModule.sLeft(kho.NgayHoaDon, 4));
                        ngtgt3.SetParameterValue(13, modGeneral.Tranlated("Đơn vị", ""));
                        ngtgt3.SetParameterValue(14, modGeneral.Tranlated("Địa chỉ", ""));
                        ngtgt3.SetParameterValue(15, modGeneral.Tranlated("M\x00e3 số thuế", ""));
                        ngtgt3.SetParameterValue(0x10, modGeneral.Tranlated("Thanh to\x00e1n bằng", ""));
                        ngtgt3.SetParameterValue(0x11, modGeneral.Tranlated("STT", ""));
                        ngtgt3.SetParameterValue(0x12, modGeneral.Tranlated("T\x00caN H\x00c0NG H\x00d3A, DỊCH VỤ", ""));
                        ngtgt3.SetParameterValue(0x13, modGeneral.Tranlated("ĐVT", ""));
                        ngtgt3.SetParameterValue(20, modGeneral.Tranlated("SỐ LƯỢNG", ""));
                        ngtgt3.SetParameterValue(0x15, modGeneral.Tranlated("ĐƠN GI\x00c1", ""));
                        ngtgt3.SetParameterValue(0x16, modGeneral.Tranlated("TH\x00c0NH TIỀN", ""));
                        ngtgt3.SetParameterValue(0x17, modGeneral.Tranlated("Chiết khấu", ""));
                        ngtgt3.SetParameterValue(0x18, modGeneral.Tranlated("Thuế suất GTGT", ""));
                        ngtgt3.SetParameterValue(0x19, modGeneral.Tranlated("Cộng tiền h\x00e0ng", ""));
                        ngtgt3.SetParameterValue(0x1a, modGeneral.Tranlated("Tiền chiết khấu", ""));
                        ngtgt3.SetParameterValue(0x1b, modGeneral.Tranlated("Tiền thuế GTGT", ""));
                        ngtgt3.SetParameterValue(0x1c, modGeneral.Tranlated("Tổng tiền thanh to\x00e1n", ""));
                        ngtgt3.SetParameterValue(0x1d, modGeneral.Tranlated("Số tiền bằng chữ", ""));
                        ngtgt3.SetParameterValue(30, Number2Char(Conversions.ToString(a), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                        ngtgt3.SetParameterValue(0x1f, modGeneral.Tranlated("NGƯỜI MUA H\x00c0NG", ""));
                        ngtgt3.SetParameterValue(0x20, modGeneral.Tranlated("NGƯỜI B\x00c1N H\x00c0NG", ""));
                        ngtgt3.SetParameterValue(0x21, modGeneral.Tranlated("( K\x00fd, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt3.SetParameterValue(0x22, modGeneral.Tranlated("( K\x00fd, đ\x00f3ng dấu, ghi r\x00f5 họ t\x00ean )", ""));
                        ngtgt3.SetParameterValue(0x24, modGeneral.Tranlated("Người mua h\x00e0ng:", ""));
                        ngtgt3.SetParameterValue(0x25, modGeneral.Tranlated(Conversions.ToString(tyLeChietKhau), ""));
                        if (str2 != "VWVBRTT")
                        {
                            ngtgt3.SetParameterValue(0x26, modGeneral.Tranlated(Conversions.ToString(thueSuat), ""));
                        }
                        else
                        {
                            ngtgt3.SetParameterValue(0x26, modGeneral.Tranlated(" ", ""));
                        }
                        ngtgt3.SetParameterValue(0x27, modGeneral.Tranlated(modGeneral.H_ACOUNTTNUMBERVND, ""));
                        ngtgt3.SetParameterValue(40, modGeneral.Tranlated(modGeneral.H_BANK, ""));
                        ngtgt3.SetParameterValue(0x29, "In tại: " + modGeneral.H_COMPANYNAMEVIET + ", M\x00e3 số thuế: " + modGeneral.H_TAXCODE);
                        ngtgt3.SetParameterValue(0x2a, modGeneral.Tranlated("THỦ TRƯỞNG ĐƠN VỊ", ""));
                        if (pTask == "Preview")
                        {
                            ngtgt3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ngtgt3;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowPrintButton = false;
                            MyProject.Forms.Frm_ViewReport.ReportViewer.ShowExportButton = false;
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                            MyProject.Forms.Frm_ViewReport.ShowDialog();
                        }
                        else if (pTask == "Print")
                        {
                            ngtgt3.PageHeaderSection2.SectionFormat.EnableSuppress = true;
                            ngtgt3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("H\x00f3a đơn GTGT ch\x00ednh thức đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                        else if (pTask == "Copy")
                        {
                            ngtgt3.PageHeaderSection2.SectionFormat.EnableSuppress = false;
                            ngtgt3.PrintToPrinter(1, true, 0, 0);
                            LVYModule.ShowWarning("Bản sao h\x00f3a đơn GTGT đ\x00e3 in th\x00e0nh c\x00f4ng!");
                            if (Form.ActiveForm != null)
                            {
                                Form.ActiveForm.Cursor = Cursors.Default;
                            }
                        }
                    }
                    catch (Exception exception5)
                    {
                        ProjectData.SetProjectError(exception5);
                        Exception exception3 = exception5;
                        MessageBox.Show(exception3.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintHoaHong(string strKhoa)
        {
            clsHoaHong hong = new clsHoaHong();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            DataTable dataPrintPhieuHoaHong = hong.GetDataPrintPhieuHoaHong(strKhoa);
            clsDMLoaiTien tien = new clsDMLoaiTien();
            hong.Load(strKhoa);
            tien.LoadByCode(dataPrintPhieuHoaHong.Rows[0]["LoaiTien"].ToString().Trim());
            if (dataPrintPhieuHoaHong.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                if (dataPrintPhieuHoaHong == null)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu!", ""));
                }
                if (dataPrintPhieuHoaHong.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu!", ""));
                }
                Rpt_HoaHong hong2 = new Rpt_HoaHong();
                try
                {
                    hong2.SetDataSource(dataPrintPhieuHoaHong);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        hong2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        hong2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    hong2.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    hong2.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    hong2.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    hong2.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    hong2.SetParameterValue(5, modGeneral.Tranlated("ĐỀ XUẤT CHI HOA HỒNG", ""));
                    hong2.SetParameterValue(6, modGeneral.Tranlated("Số h\x00f3a đơn", ""));
                    hong2.SetParameterValue(7, modGeneral.Tranlated("Ng\x00e0y h\x00f3a đơn", ""));
                    hong2.SetParameterValue(8, modGeneral.Tranlated("T\x00ean đối tượng", ""));
                    hong2.SetParameterValue(9, modGeneral.Tranlated("M\x00e3", ""));
                    hong2.SetParameterValue(10, modGeneral.Tranlated("Diễn giải", ""));
                    hong2.SetParameterValue(11, modGeneral.Tranlated("Số tiền", ""));
                    hong2.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    hong2.SetParameterValue(13, modGeneral.Tranlated("LẬP BIỂU", ""));
                    hong2.SetParameterValue(14, tien.SoLe);
                    hong2.SetParameterValue(15, hong.SoTienHoaHong - hong.SoTienThuLai);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hong2;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintKHThanhToan(string strKhoa)
        {
            clsThanhToan toan = new clsThanhToan();
            clsDMDoiTuong tuong = new clsDMDoiTuong();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            toan.Load(strKhoa);
            DataTable dataPrint = toan.GetDataPrint(strKhoa);
            if (toan.SoTienKhongPhanBo != 0.0)
            {
                DataRow row = dataPrint.NewRow();
                row[0] = "";
                row[1] = "";
                khoan.Load(toan.KhoaTaiKhoanDoi);
                row[2] = khoan.SoTaiKhoan;
                row[3] = "";
                row[4] = "";
                row[5] = toan.HinhThucThanhToan;
                if (toan.KhoaNganHang.Trim() == "")
                {
                    row[6] = "";
                }
                else
                {
                    tuong.Load(toan.KhoaNganHang);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        row[6] = tuong.TenViet;
                    }
                    else
                    {
                        row[6] = tuong.TenAnh;
                    }
                }
                tuong.Load(toan.KhoaDoiTuong);
                if (modGeneral.H_LANGUAGE == "VIET")
                {
                    row[7] = tuong.TenViet;
                }
                else
                {
                    row[7] = tuong.TenAnh;
                }
                khoan.Load(toan.KhoaTaiKhoanChu);
                row[8] = khoan.SoTaiKhoan;
                row[9] = "";
                row[10] = "";
                row[11] = 0;
                row[12] = 0;
                row[13] = 0;
                row[14] = toan.SoTienKhongPhanBo;
                dataPrint.Rows.Add(row);
            }
            string str = "";
            string val = "";
            if (toan.HinhThucThanhToan == "TM")
            {
                str = modGeneral.Tranlated("Tiền mặt", "");
            }
            if (toan.HinhThucThanhToan == "CK")
            {
                str = modGeneral.Tranlated("Chuyển khoản", "");
                val = modGeneral.Tranlated("Ng\x00e2n h\x00e0ng", "") + ":";
            }
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_KhachHangThanhToan toan2 = new Rpt_KhachHangThanhToan();
                try
                {
                    toan2.SetDataSource(dataPrint);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        toan2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        toan2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    toan2.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    toan2.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    toan2.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    toan2.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    toan2.SetParameterValue(5, modGeneral.Tranlated("KH\x00c1CH H\x00c0NG THANH TO\x00c1N", ""));
                    toan2.SetParameterValue(6, modGeneral.Tranlated("Số chứng từ", "") + ":");
                    toan2.SetParameterValue(7, modGeneral.Tranlated("T\x00e0i khoản nợ", "") + ":");
                    toan2.SetParameterValue(8, modGeneral.Tranlated("H\x00ecnh thức", "") + ": " + str);
                    toan2.SetParameterValue(10, val);
                    toan2.SetParameterValue(11, modGeneral.Tranlated("Đ\x00ednh k\x00e8m", "") + ":");
                    toan2.SetParameterValue(12, modGeneral.Tranlated("Diễn giải", "") + ":");
                    toan2.SetParameterValue(13, modGeneral.Tranlated("Kh\x00e1ch h\x00e0ng", "") + ":");
                    toan2.SetParameterValue(14, modGeneral.Tranlated("T\x00e0i khoản c\x00f3", ""));
                    toan2.SetParameterValue(15, modGeneral.Tranlated("Số chứng từ ", ""));
                    toan2.SetParameterValue(0x10, "Ng\x00e0y " + LVYModule.sRight(toan.NgayChungTu, 2) + " th\x00e1ng " + LVYModule.sMid(toan.NgayChungTu, 5, 2) + " năm " + LVYModule.sLeft(toan.NgayChungTu, 4));
                    toan2.SetParameterValue(0x11, modGeneral.Tranlated("Tiền h\x00e0ng", ""));
                    toan2.SetParameterValue(0x12, modGeneral.Tranlated("Chiết khấu", ""));
                    toan2.SetParameterValue(0x13, modGeneral.Tranlated("Thuế", ""));
                    toan2.SetParameterValue(20, modGeneral.Tranlated("Ng\x00e0y ...... th\x00e1ng ...... năm ......", ""));
                    toan2.SetParameterValue(0x15, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    toan2.SetParameterValue(0x16, modGeneral.Tranlated("Tổng tiền", ""));
                    toan2.SetParameterValue(0x17, modGeneral.Tranlated("Thanh to\x00e1n", ""));
                    toan2.SetParameterValue(0x18, modGeneral.Tranlated("Tổng cộng", "") + ":");
                    toan2.SetParameterValue(0x19, "Bằng chữ: " + Number2Char(Conversions.ToString(Math.Round(toan.SoTienNT, 0)), ".") + " (" + toan.LoaiTien.Trim() + ")");
                    toan2.SetParameterValue(0x1a, modGeneral.Tranlated("Ng\x00e0y", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = toan2;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintNhapKhau(string strKhoa)
        {
            clsNhapKho kho = new clsNhapKho();
            string strTKNo = "";
            string strTKCo = "";
            double num2 = 0.0;
            double val = 0.0;
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            val = kho.GetAllVATChiPhi(strKhoa) + (kho.TienThueVAT + kho.TienThuePhiNK);
            num2 = (kho.TienHang + kho.TienThueNhapKhau) + kho.TienThueVAT;
            kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            DataTable dataPrintNhapKhau = kho.GetDataPrintNhapKhau(strKhoa);
            if (dataPrintNhapKhau.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_NhapKhau khau = new Rpt_NhapKhau();
                try
                {
                    khau.SetDataSource(dataPrintNhapKhau);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        khau.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        khau.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    khau.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    khau.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    khau.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    khau.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    khau.SetParameterValue(5, modGeneral.Tranlated("PHIẾU NHẬP KHO", ""));
                    khau.SetParameterValue(6, LVYModule.Date2Letter(LVYModule.Char2Date(kho.NgayChungTu)));
                    khau.SetParameterValue(7, modGeneral.Tranlated("Số chứng từ", "") + ":");
                    khau.SetParameterValue(8, modGeneral.Tranlated("Người giao h\x00e0ng", "") + ":");
                    khau.SetParameterValue(9, modGeneral.Tranlated("Nh\x00e0 cung cấp", "") + ":");
                    khau.SetParameterValue(10, modGeneral.Tranlated("Số tờ khai", "") + ":");
                    khau.SetParameterValue(11, modGeneral.Tranlated("Ng\x00e0y", "") + ":");
                    khau.SetParameterValue(12, modGeneral.Tranlated("Invoice", "") + ":");
                    khau.SetParameterValue(13, modGeneral.Tranlated("Số h\x00f3a đơn", "") + ":");
                    khau.SetParameterValue(14, modGeneral.Tranlated("K\x00fd hiệu", "") + ":");
                    khau.SetParameterValue(15, modGeneral.Tranlated("Th\x00e0nh tiền", "") + ":");
                    khau.SetParameterValue(0x10, modGeneral.Tranlated("Số chứng từ gốc k\x00e8m theo", "") + ":");
                    khau.SetParameterValue(0x11, modGeneral.Tranlated("Người lập phiếu", ""));
                    khau.SetParameterValue(0x12, modGeneral.Tranlated("Người giao h\x00e0ng", ""));
                    khau.SetParameterValue(0x13, modGeneral.Tranlated("Thủ kho", ""));
                    khau.SetParameterValue(20, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    khau.SetParameterValue(0x15, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", ""));
                    khau.SetParameterValue(0x16, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo);
                    khau.SetParameterValue(0x17, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo);
                    khau.SetParameterValue(0x18, modGeneral.Tranlated("STT", ""));
                    khau.SetParameterValue(0x19, modGeneral.Tranlated("T\x00ean, nh\x00e3n hiệu, quy c\x00e1ch phẩm chất vật tư h\x00e0ng h\x00f3a", ""));
                    khau.SetParameterValue(0x1a, modGeneral.Tranlated("M\x00e3 số", ""));
                    khau.SetParameterValue(0x1b, modGeneral.Tranlated("ĐVT", ""));
                    khau.SetParameterValue(0x1c, modGeneral.Tranlated("Số lượng", ""));
                    khau.SetParameterValue(0x1d, modGeneral.Tranlated("Đơn gi\x00e1", ""));
                    khau.SetParameterValue(30, modGeneral.Tranlated("Th\x00e0nh tiền", ""));
                    khau.SetParameterValue(0x1f, modGeneral.Tranlated("Thuế N.Khẩu", ""));
                    khau.SetParameterValue(0x20, modGeneral.Tranlated("Thuế VAT", ""));
                    khau.SetParameterValue(0x21, modGeneral.Tranlated("Ng\x00e0y ..... th\x00e1ng ..... năm ............", ""));
                    khau.SetParameterValue(0x22, modGeneral.Tranlated("Diễn giải", ""));
                    khau.SetParameterValue(0x23, modGeneral.Tranlated("Tổng tiền h\x00e0ng", "") + ":");
                    khau.SetParameterValue(0x24, modGeneral.Tranlated("Nhập khẩu", ""));
                    khau.SetParameterValue(0x25, modGeneral.Tranlated("Chi ph\x00ed", ""));
                    khau.SetParameterValue(0x26, modGeneral.Tranlated("Ph\x00e1t sinh", ""));
                    khau.SetParameterValue(0x27, modGeneral.Tranlated("Thuế", ""));
                    khau.SetParameterValue(40, modGeneral.Tranlated("Tiền vốn", ""));
                    khau.SetParameterValue(0x29, modGeneral.Tranlated("Tổng thuế VAT", ""));
                    khau.SetParameterValue(0x2a, modGeneral.Tranlated("Tổng cộng", ""));
                    khau.SetParameterValue(0x2b, val);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = khau;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintNhapKho(string strKhoa)
        {
            clsNhapKho kho = new clsNhapKho();
            string strTKNo = "";
            string strTKCo = "";
            double num = 0.0;
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            num = (kho.TienHang + kho.TienThueNhapKhau) + kho.TienThueVAT;
            kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            DataTable dataPrint = kho.GetDataPrint(strKhoa);
            if (dataPrint != null)
            {
                if (dataPrint.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
                }
                else
                {
                    object obj2;
                    if (modGeneral.H_THEODOIHANDUNG & modGeneral.H_THEODOISOLOHANG)
                    {
                        obj2 = new Rpt_NhapKho1();
                    }
                    else
                    {
                        obj2 = new Rpt_NhapKho();
                    }
                    try
                    {
                        object[] arguments = new object[] { dataPrint };
                        bool[] copyBack = new bool[] { true };
                        NewLateBinding.LateCall(obj2, null, "SetDataSource", arguments, null, null, copyBack, true);
                        if (copyBack[0])
                        {
                            dataPrint = (DataTable) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(DataTable));
                        }
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, "") }, null, null, null, true);
                        }
                        else
                        {
                            NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, "") }, null, null, null, true);
                        }
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 5, modGeneral.Tranlated("PHIẾU NHẬP KHO", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 6, LVYModule.Date2Letter(LVYModule.Char2Date(kho.NgayChungTu)) }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 7, modGeneral.Tranlated("Số chứng từ", "") + ": " + kho.SoChungTu }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 8, modGeneral.Tranlated("Tiền h\x00e0ng", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 9, modGeneral.Tranlated("Nh\x00e0 cung cấp", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 10, modGeneral.Tranlated("Người giao", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 11, modGeneral.Tranlated("M\x00f4 tả", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 12, modGeneral.Tranlated("K\x00fd hiệu", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 13, modGeneral.Tranlated("Số h\x00f3a đơn", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 14, modGeneral.Tranlated("Ng\x00e0y", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 15, modGeneral.Tranlated("Tổng số tiền", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x10, modGeneral.Tranlated("Số chứng từ gốc k\x00e8m theo", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x11, modGeneral.Tranlated("Người lập phiếu", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x12, modGeneral.Tranlated("Người giao h\x00e0ng", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x13, modGeneral.Tranlated("Thủ kho", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 20, modGeneral.Tranlated("Gi\x00e1m đốc", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x15, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x16, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x17, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x18, modGeneral.Tranlated("STT", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x19, modGeneral.Tranlated("T\x00ean, nh\x00e3n hiệu, quy c\x00e1ch phẩm chất vật tư h\x00e0ng h\x00f3a", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1a, modGeneral.Tranlated("M\x00e3 số", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1b, modGeneral.Tranlated("ĐVT", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1c, modGeneral.Tranlated("SL", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1d, modGeneral.Tranlated("Đơn gi\x00e1", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 30, modGeneral.Tranlated("Th\x00e0nh tiền", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1f, modGeneral.Tranlated("Thuế nhập khẩu", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x20, modGeneral.Tranlated("Tiền thuế", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x21, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x22, modGeneral.Tranlated("Bằng chữ", "") + ": " + Number2Char(Conversions.ToString(num), ".") + " (VND)" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x23, modGeneral.Tranlated("Tổng cộng", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x24, modGeneral.Tranlated("Số l\x00f4", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x25, modGeneral.Tranlated("Hạn sử dụng", "") }, null, null, null, true);
                        MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = RuntimeHelpers.GetObjectValue(obj2);
                        MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                        MyProject.Forms.Frm_ViewReport.ShowDialog();
                        if (Form.ActiveForm != null)
                        {
                            Form.ActiveForm.Cursor = Cursors.Default;
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        if (Form.ActiveForm != null)
                        {
                            Form.ActiveForm.Cursor = Cursors.Default;
                        }
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintNhapKhoNoiBo(string strKhoa)
        {
            clsNhapKho kho = new clsNhapKho();
            string strTKNo = "";
            string strTKCo = "";
            double num = 0.0;
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            num = (kho.TienHang + kho.TienThueNhapKhau) + kho.TienThueVAT;
            kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            DataTable dataPrint = kho.GetDataPrint(strKhoa);
            if (dataPrint != null)
            {
                if (dataPrint.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
                }
                else
                {
                    object obj2;
                    if (modGeneral.H_THEODOIHANDUNG & modGeneral.H_THEODOISOLOHANG)
                    {
                        obj2 = new Rpt_NhapKhoNoiBo1();
                    }
                    else
                    {
                        obj2 = new Rpt_NhapKhoNoiBo();
                    }
                    try
                    {
                        object[] arguments = new object[] { dataPrint };
                        bool[] copyBack = new bool[] { true };
                        NewLateBinding.LateCall(obj2, null, "SetDataSource", arguments, null, null, copyBack, true);
                        if (copyBack[0])
                        {
                            dataPrint = (DataTable) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(DataTable));
                        }
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, "") }, null, null, null, true);
                        }
                        else
                        {
                            NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, "") }, null, null, null, true);
                        }
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 5, modGeneral.Tranlated("PHIẾU NHẬP KHO", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 6, LVYModule.Date2Letter(LVYModule.Char2Date(kho.NgayChungTu)) }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 7, modGeneral.Tranlated("Số chứng từ", "") + ": " + kho.SoChungTu }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 8, modGeneral.Tranlated("Tiền h\x00e0ng", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 9, modGeneral.Tranlated("Nh\x00e0 cung cấp", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 10, modGeneral.Tranlated("Người giao", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 11, modGeneral.Tranlated("M\x00f4 tả", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 12, modGeneral.Tranlated("K\x00fd hiệu", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 13, modGeneral.Tranlated("Số h\x00f3a đơn", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 14, modGeneral.Tranlated("Ng\x00e0y", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 15, modGeneral.Tranlated("Tổng số tiền", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x10, modGeneral.Tranlated("Số chứng từ gốc k\x00e8m theo", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x11, modGeneral.Tranlated("Người lập phiếu", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x12, modGeneral.Tranlated("Người giao h\x00e0ng", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x13, modGeneral.Tranlated("Thủ kho", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 20, modGeneral.Tranlated("Gi\x00e1m đốc", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x15, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x16, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x17, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x18, modGeneral.Tranlated("STT", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x19, modGeneral.Tranlated("T\x00ean, nh\x00e3n hiệu, quy c\x00e1ch phẩm chất vật tư h\x00e0ng h\x00f3a", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1a, modGeneral.Tranlated("M\x00e3 số", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1b, modGeneral.Tranlated("ĐVT", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1c, modGeneral.Tranlated("SL", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1d, modGeneral.Tranlated("Đơn gi\x00e1", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 30, modGeneral.Tranlated("Th\x00e0nh tiền", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1f, modGeneral.Tranlated("Thuế nhập khẩu", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x20, modGeneral.Tranlated("Tiền thuế", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x21, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x22, modGeneral.Tranlated("Bằng chữ", "") + ": " + Number2Char(Conversions.ToString(num), ".") + " (VND)" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x23, modGeneral.Tranlated("Tổng cộng", "") + ":" }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x24, modGeneral.Tranlated("Số l\x00f4", "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x25, modGeneral.Tranlated("Hạn sử dụng", "") }, null, null, null, true);
                        MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = RuntimeHelpers.GetObjectValue(obj2);
                        MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                        MyProject.Forms.Frm_ViewReport.ShowDialog();
                        if (Form.ActiveForm != null)
                        {
                            Form.ActiveForm.Cursor = Cursors.Default;
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        if (Form.ActiveForm != null)
                        {
                            Form.ActiveForm.Cursor = Cursors.Default;
                        }
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintPhanTichDonHang(string strKhoa, string strLanguage = "VIET")
        {
            clsDonDatHang hang = new clsDonDatHang();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            hang.Load(strKhoa);
            DataTable dataPrintPhanTichDonHang = hang.GetDataPrintPhanTichDonHang(strKhoa, strLanguage);
            if (dataPrintPhanTichDonHang != null)
            {
                if (dataPrintPhanTichDonHang.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
                }
                else
                {
                    if (dataPrintPhanTichDonHang == null)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu!", ""));
                    }
                    if (dataPrintPhanTichDonHang.Rows.Count == 0)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu!", ""));
                    }
                    Rpt_PhanTichDonHang hang2 = new Rpt_PhanTichDonHang();
                    try
                    {
                        hang2.SetDataSource(dataPrintPhanTichDonHang);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            hang2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            hang2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        hang2.SetParameterValue(1, modGeneral.H_ADDRESS);
                        hang2.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                        hang2.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                        hang2.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                        hang2.SetParameterValue(5, modGeneral.Tranlated("ĐƠN ĐẶT H\x00c0NG", ""));
                        hang2.SetParameterValue(6, modGeneral.Tranlated("Số", "") + ":" + hang.SoChungTu);
                        hang2.SetParameterValue(7, LVYModule.Date2Letter(LVYModule.Char2Date(hang.NgayChungTu)));
                        clsDMLoaiTien tien = new clsDMLoaiTien();
                        tien.LoadByCode(hang.LoaiTien.Trim());
                        hang2.SetParameterValue(8, tien.SoLe);
                        MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hang2;
                        MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                        if (Form.ActiveForm != null)
                        {
                            Form.ActiveForm.Cursor = Cursors.Default;
                        }
                        MyProject.Forms.Frm_ViewReport.ShowDialog();
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public static void PrintPhieuChi(string strKhoa)
        {
            clsChungTuQuy quy = new clsChungTuQuy();
            string strTKNo = "";
            string strTKCo = "";
            double num = 0.0;
            quy.Load(strKhoa);
            num = Convert.ToDouble(quy.SoTien);
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            quy.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            DataTable dataPrint = quy.GetDataPrint(strKhoa);
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                RptPhieuChi chi = new RptPhieuChi();
                try
                {
                    chi.SetDataSource(dataPrint);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        chi.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        chi.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    chi.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    chi.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    chi.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    chi.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    chi.SetParameterValue(5, modGeneral.Tranlated("PHIẾU CHI", ""));
                    chi.SetParameterValue(6, modGeneral.Tranlated("Năm th\x00e1ng", ""));
                    chi.SetParameterValue(7, "Số");
                    chi.SetParameterValue(8, "Ng\x00e0y " + LVYModule.sRight(quy.NgayChungTu, 2) + " th\x00e1ng " + LVYModule.sMid(quy.NgayChungTu, 5, 2) + " năm " + LVYModule.sLeft(quy.NgayChungTu, 4));
                    chi.SetParameterValue(10, "Địa chỉ");
                    chi.SetParameterValue(11, "Người nhận tiền");
                    chi.SetParameterValue(12, "Số CMND");
                    chi.SetParameterValue(13, modGeneral.Tranlated("Diễn giải", ""));
                    chi.SetParameterValue(14, modGeneral.Tranlated("Loại tiền", ""));
                    chi.SetParameterValue(15, modGeneral.Tranlated("K\x00e8m theo ", ""));
                    chi.SetParameterValue(0x10, "Bằng chữ:" + Number2Char(Conversions.ToString(Math.Round(quy.SoTienNT, 0)), ".") + " (" + quy.LoaiTien.Trim() + ")");
                    chi.SetParameterValue(0x11, quy.SoTienNT);
                    chi.SetParameterValue(0x12, modGeneral.Tranlated("Tổng tiền", ""));
                    chi.SetParameterValue(0x13, "Chứng từ gốc");
                    chi.SetParameterValue(0x15, modGeneral.Tranlated("Ng\x00e0y ...... th\x00e1ng ...... năm ...............", ""));
                    chi.SetParameterValue(0x16, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    chi.SetParameterValue(0x17, modGeneral.Tranlated("Người lập phiếu", ""));
                    chi.SetParameterValue(0x18, modGeneral.Tranlated("Người giao tiền", ""));
                    chi.SetParameterValue(0x19, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    chi.SetParameterValue(0x1a, modGeneral.Tranlated("Thủ quỹ", ""));
                    chi.SetParameterValue(0x1b, modGeneral.Tranlated("Thủ trưởng", ""));
                    chi.SetParameterValue(0x1c, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", ""));
                    chi.SetParameterValue(0x1d, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo);
                    chi.SetParameterValue(30, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo);
                    chi.SetParameterValue(0x1f, modGeneral.Tranlated("Số tiền ", ""));
                    chi.SetParameterValue(0x20, modGeneral.Tranlated("TK ", ""));
                    chi.SetParameterValue(0x21, modGeneral.Tranlated("STT ", ""));
                    chi.SetParameterValue(0x22, modGeneral.Tranlated("Số TK ", ""));
                    chi.SetParameterValue(0x23, modGeneral.Tranlated("Đối tượng ", ""));
                    chi.SetParameterValue(0x24, modGeneral.Tranlated("Tiền quy đổi ", ""));
                    chi.SetParameterValue(0x25, modGeneral.Tranlated("Khoản mục ", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = chi;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintPhieuChiTH(string strKhoa)
        {
            clsChungTuQuy quy = new clsChungTuQuy();
            string strTKNo = "";
            string strTKCo = "";
            double num = 0.0;
            quy.Load(strKhoa);
            num = Convert.ToDouble(quy.SoTien);
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            DataTable dataPrint = quy.GetDataPrint(strKhoa);
            quy.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                RptPhieuChiTH ith = new RptPhieuChiTH();
                try
                {
                    ith.SetDataSource(dataPrint);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        ith.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        ith.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    ith.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    ith.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    ith.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    ith.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    ith.SetParameterValue(5, modGeneral.Tranlated("PHIẾU CHI", ""));
                    ith.SetParameterValue(6, "(" + quy.LoaiTien.Trim() + ")");
                    ith.SetParameterValue(7, "Số: " + quy.SoChungTu);
                    ith.SetParameterValue(8, "Ng\x00e0y " + LVYModule.sRight(quy.NgayChungTu, 2) + " th\x00e1ng " + LVYModule.sMid(quy.NgayChungTu, 5, 2) + " năm " + LVYModule.sLeft(quy.NgayChungTu, 4));
                    ith.SetParameterValue(9, "Địa chỉ : " + quy.DiaChi);
                    ith.SetParameterValue(10, "Người nhận tiền: " + quy.NguoiDaiDien);
                    ith.SetParameterValue(11, modGeneral.Tranlated("Số tiền :", ""));
                    ith.SetParameterValue(12, modGeneral.Tranlated("L\x00fd do chi :", ""));
                    ith.SetParameterValue(13, modGeneral.Tranlated("Loại tiền :", ""));
                    ith.SetParameterValue(14, modGeneral.Tranlated("K\x00e8m theo :", ""));
                    ith.SetParameterValue(15, "Bằng chữ :" + Number2Char(Conversions.ToString(Math.Round(quy.SoTien, 0)), ".") + " (" + quy.LoaiTien.Trim() + ")");
                    ith.SetParameterValue(0x10, quy.SoTien);
                    ith.SetParameterValue(0x11, modGeneral.Tranlated("K\x00e8m theo :", ""));
                    ith.SetParameterValue(0x12, modGeneral.Tranlated("Chứng từ gốc", ""));
                    ith.SetParameterValue(0x13, modGeneral.Tranlated("Ng\x00e0y ...... th\x00e1ng ...... năm ...............", ""));
                    ith.SetParameterValue(0x15, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    ith.SetParameterValue(20, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    ith.SetParameterValue(0x16, modGeneral.Tranlated("Người lập phiếu", ""));
                    ith.SetParameterValue(0x17, modGeneral.Tranlated("Người nhận tiền", ""));
                    ith.SetParameterValue(0x18, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    ith.SetParameterValue(0x19, modGeneral.Tranlated("Thủ quỹ", ""));
                    ith.SetParameterValue(0x1a, modGeneral.Tranlated("Thủ trưởng", ""));
                    ith.SetParameterValue(0x1b, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", ""));
                    ith.SetParameterValue(0x1c, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo);
                    ith.SetParameterValue(0x1d, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ith;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintPhieuGiaoHang(string strKhoa, string strLanguage = "VIET")
        {
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            double num = 0.0;
            string strTKNo = "";
            string strTKCo = "";
            clsDMLoaiTien tien = new clsDMLoaiTien();
            string str = "";
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            tien.LoadByCode(kho.LoaiTien.Trim());
            DataTable dataPrint = kho.GetDataPrint(strKhoa, strLanguage);
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
                Rpt_PhieuGiaoHang hang = new Rpt_PhieuGiaoHang();
                try
                {
                    hang.SetDataSource(dataPrint);
                    hang.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    hang.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    hang.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    hang.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    hang.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    hang.SetParameterValue(5, modGeneral.Tranlated("PHIẾU GIAO H\x00c0NG", strLanguage));
                    hang.SetParameterValue(6, modGeneral.Tranlated("Kh\x00e1ch h\x00e0ng", strLanguage));
                    hang.SetParameterValue(7, modGeneral.Tranlated("Địa chỉ", strLanguage));
                    hang.SetParameterValue(8, modGeneral.Tranlated("M\x00e3 số thuế", strLanguage));
                    hang.SetParameterValue(9, modGeneral.Tranlated("M\x00e3 kh\x00e1ch", strLanguage));
                    hang.SetParameterValue(10, modGeneral.Tranlated("Số h\x00f3a đơn", strLanguage));
                    hang.SetParameterValue(11, modGeneral.Tranlated("Số", strLanguage) + ": " + kho.SoChungTu.Trim());
                    hang.SetParameterValue(12, modGeneral.Tranlated("Số t\x00e0i khoản", strLanguage));
                    hang.SetParameterValue(13, modGeneral.Tranlated("STT", strLanguage));
                    hang.SetParameterValue(14, modGeneral.Tranlated("T\x00caN H\x00c0NG", strLanguage));
                    hang.SetParameterValue(15, modGeneral.Tranlated("ĐVT", strLanguage));
                    hang.SetParameterValue(0x10, "Bằng chữ: " + Number2Char(Conversions.ToString(num), ".") + " (" + modGeneral.H_CURRENCY.Trim() + ")");
                    hang.SetParameterValue(0x11, modGeneral.Tranlated("M\x00c3 SỐ", strLanguage));
                    hang.SetParameterValue(0x12, modGeneral.Tranlated("SL", strLanguage));
                    hang.SetParameterValue(0x13, modGeneral.Tranlated("ĐƠN GI\x00c1", strLanguage));
                    hang.SetParameterValue(20, modGeneral.Tranlated("Người giao", strLanguage));
                    hang.SetParameterValue(0x15, modGeneral.Tranlated("Người nhận", strLanguage));
                    hang.SetParameterValue(0x16, modGeneral.Tranlated("Thủ kho", strLanguage));
                    hang.SetParameterValue(0x17, modGeneral.Tranlated("Lập phiếu", strLanguage));
                    hang.SetParameterValue(0x18, modGeneral.Tranlated("Thủ trưởng đơn vị", strLanguage));
                    hang.SetParameterValue(0x19, modGeneral.Tranlated("(ghi r\x00f5 họ t\x00ean)", strLanguage));
                    hang.SetParameterValue(0x1a, modGeneral.Tranlated("TH\x00c0NH TIỀN", strLanguage));
                    hang.SetParameterValue(0x1b, modGeneral.Tranlated("Tổng tiền h\x00e0ng", strLanguage));
                    hang.SetParameterValue(0x1c, modGeneral.Tranlated("TIỀN THUẾ", strLanguage));
                    hang.SetParameterValue(0x1d, modGeneral.Tranlated("Ti\x00eàn thanh to\x00e1n", strLanguage));
                    hang.SetParameterValue(30, modGeneral.Tranlated("(%)Thuế", strLanguage));
                    hang.SetParameterValue(0x1f, modGeneral.Tranlated("C.KHẤU", strLanguage));
                    hang.SetParameterValue(0x20, LVYModule.DateLetter(LVYModule.Char2Date(kho.NgayChungTu), "VIET"));
                    hang.SetParameterValue(0x21, modGeneral.Tranlated("THUẾ", strLanguage));
                    hang.SetParameterValue(0x22, modGeneral.Tranlated("Giao h\x00e0ng tại", strLanguage));
                    if (kho.DienGiaiGiaoHang.Trim() != "")
                    {
                        str = "(" + kho.DienGiaiGiaoHang.Trim() + ")";
                    }
                    hang.SetParameterValue(0x23, kho.DiaChiGiaoHang.Trim() + " " + str);
                    hang.SetParameterValue(0x24, modGeneral.Tranlated("Loại tiền", strLanguage));
                    hang.SetParameterValue(0x25, modGeneral.Tranlated("Tỷ gi\x00e1", strLanguage));
                    hang.SetParameterValue(0x26, modGeneral.Tranlated("Quy đổi", strLanguage) + ":");
                    hang.SetParameterValue(0x27, num);
                    hang.SetParameterValue(40, tien.SoLe);
                    hang.SetParameterValue(0x29, kho.TienChietKhauNT);
                    hang.SetParameterValue(0x2a, kho.TienThueVATNT);
                    hang.SetParameterValue(0x2b, modGeneral.Tranlated("Tiền h\x00e0ng", strLanguage));
                    hang.SetParameterValue(0x2c, modGeneral.Tranlated("Chiết khấu", strLanguage));
                    hang.SetParameterValue(0x2d, modGeneral.Tranlated("Tiền thuế", strLanguage));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hang;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintPhieuThu(string strKhoa)
        {
            clsChungTuQuy quy = new clsChungTuQuy();
            string strTKNo = "";
            string strTKCo = "";
            double num = 0.0;
            quy.Load(strKhoa);
            num = Convert.ToDouble(quy.SoTien);
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            quy.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            DataTable dataPrintCT = quy.GetDataPrintCT(strKhoa);
            if (dataPrintCT.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                RptPhieuThu thu = new RptPhieuThu();
                try
                {
                    thu.SetDataSource(dataPrintCT);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        thu.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        thu.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    thu.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    thu.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    thu.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    thu.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    thu.SetParameterValue(5, modGeneral.Tranlated("PHIẾU THU", ""));
                    thu.SetParameterValue(6, modGeneral.Tranlated("Năm th\x00e1ng", ""));
                    thu.SetParameterValue(7, "Số");
                    thu.SetParameterValue(8, "Ng\x00e0y " + LVYModule.sRight(quy.NgayChungTu, 2) + " th\x00e1ng " + LVYModule.sMid(quy.NgayChungTu, 5, 2) + " năm " + LVYModule.sLeft(quy.NgayChungTu, 4));
                    thu.SetParameterValue(9, "Địa chỉ");
                    thu.SetParameterValue(10, modGeneral.Tranlated("Điện thoại", ""));
                    thu.SetParameterValue(11, "Người nộp tiền");
                    thu.SetParameterValue(12, "Số CMND");
                    thu.SetParameterValue(13, modGeneral.Tranlated("Diễn giải", ""));
                    thu.SetParameterValue(14, modGeneral.Tranlated("Loại tiền", ""));
                    thu.SetParameterValue(15, modGeneral.Tranlated("K\x00e8m theo ", ""));
                    thu.SetParameterValue(0x10, "Bằng chữ:" + Number2Char(Conversions.ToString(Math.Round(quy.SoTienNT, 0)), ".") + " (" + quy.LoaiTien.Trim() + ")");
                    thu.SetParameterValue(0x11, quy.SoTien);
                    thu.SetParameterValue(0x12, modGeneral.Tranlated("Tổng tiền", ""));
                    thu.SetParameterValue(0x13, "Chứng từ gốc ");
                    thu.SetParameterValue(0x15, modGeneral.Tranlated("Ng\x00e0y ...... th\x00e1ng ...... năm ...............", ""));
                    thu.SetParameterValue(0x16, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    thu.SetParameterValue(0x17, modGeneral.Tranlated("Người lập phiếu", ""));
                    thu.SetParameterValue(0x18, modGeneral.Tranlated("Người giao tiền", ""));
                    thu.SetParameterValue(0x19, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    thu.SetParameterValue(0x1a, modGeneral.Tranlated("Thủ quỹ", ""));
                    thu.SetParameterValue(0x1b, modGeneral.Tranlated("Thủ trưởng", ""));
                    thu.SetParameterValue(0x1c, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", ""));
                    thu.SetParameterValue(0x1d, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo);
                    thu.SetParameterValue(30, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo);
                    thu.SetParameterValue(0x1f, modGeneral.Tranlated("Số tiền ", ""));
                    thu.SetParameterValue(0x20, modGeneral.Tranlated("TK ", ""));
                    thu.SetParameterValue(0x21, modGeneral.Tranlated("STT ", ""));
                    thu.SetParameterValue(0x22, modGeneral.Tranlated("Số TK ", ""));
                    thu.SetParameterValue(0x23, modGeneral.Tranlated("Đối tượng ", ""));
                    thu.SetParameterValue(0x24, modGeneral.Tranlated("Tiền quy đổi ", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = thu;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintPhieuThuTH(string strKhoa)
        {
            clsChungTuQuy quy = new clsChungTuQuy();
            string strTKNo = "";
            string strTKCo = "";
            double num = 0.0;
            quy.Load(strKhoa);
            clsDMLoaiTien tien = new clsDMLoaiTien();
            tien.LoadByCode(quy.LoaiTien.Trim());
            num = Convert.ToDouble(quy.SoTienNT);
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            quy.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
            DataTable dataPrint = quy.GetDataPrint(strKhoa);
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                RptPhieuThuTH uth = new RptPhieuThuTH();
                try
                {
                    uth.SetDataSource(dataPrint);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        uth.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        uth.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    uth.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    uth.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    uth.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    uth.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    uth.SetParameterValue(5, modGeneral.Tranlated("PHIẾU THU", ""));
                    uth.SetParameterValue(6, "(" + quy.LoaiTien.Trim() + ")");
                    uth.SetParameterValue(7, "Số: " + quy.SoChungTu);
                    uth.SetParameterValue(8, "Ng\x00e0y " + LVYModule.sRight(quy.NgayChungTu, 2) + " th\x00e1ng " + LVYModule.sMid(quy.NgayChungTu, 5, 2) + " năm " + LVYModule.sLeft(quy.NgayChungTu, 4));
                    uth.SetParameterValue(10, "Địa chỉ: " + quy.DiaChi);
                    uth.SetParameterValue(11, "Người nộp tiền: " + quy.NguoiDaiDien);
                    uth.SetParameterValue(12, modGeneral.Tranlated("Số CMND", "") + ":");
                    uth.SetParameterValue(13, modGeneral.Tranlated("L\x00fd do nộp", "") + ":");
                    uth.SetParameterValue(14, "(" + quy.LoaiTien.Trim() + ")");
                    uth.SetParameterValue(15, modGeneral.Tranlated("K\x00e8m theo ", "") + ":");
                    uth.SetParameterValue(0x10, "Bằng chữ: " + Number2Char(Conversions.ToString(Math.Round(quy.SoTienNT, tien.SoLe)), ".") + " (" + quy.LoaiTien.Trim() + ")");
                    uth.SetParameterValue(0x11, quy.SoTienNT);
                    uth.SetParameterValue(0x12, modGeneral.Tranlated("Số", "") + ":" + quy.SoChungTu.Trim());
                    uth.SetParameterValue(0x13, modGeneral.Tranlated("Chứng từ gốc", ""));
                    uth.SetParameterValue(0x15, modGeneral.Tranlated("Ng\x00e0y ...... th\x00e1ng ...... năm ...............", ""));
                    uth.SetParameterValue(0x16, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    uth.SetParameterValue(0x17, modGeneral.Tranlated("Người lập phiếu", ""));
                    uth.SetParameterValue(0x18, modGeneral.Tranlated("Người giao tiền", ""));
                    uth.SetParameterValue(0x19, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    uth.SetParameterValue(0x1a, modGeneral.Tranlated("Thủ quỹ", ""));
                    uth.SetParameterValue(0x1b, modGeneral.Tranlated("Thủ trưởng", ""));
                    uth.SetParameterValue(0x1c, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", ""));
                    uth.SetParameterValue(0x1d, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo);
                    uth.SetParameterValue(30, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo);
                    uth.SetParameterValue(0x1f, modGeneral.Tranlated("Số tiền ", "") + ":");
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = uth;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintPurchaseOrder(string strKhoa, string strLanguage)
        {
            clsDonDatHang hang = new clsDonDatHang();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            hang.Load(strKhoa);
            clsDMLoaiTien tien = new clsDMLoaiTien();
            tien.LoadByCode(hang.LoaiTien);
            DataTable dataPrint = hang.GetDataPrint(strKhoa, strLanguage);
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                object obj2;
                if (dataPrint == null)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu!", ""));
                }
                if (dataPrint.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu!", ""));
                }
                if (hang.TienThueNT > 0.0)
                {
                    obj2 = new PurchaseOrder4();
                }
                else
                {
                    obj2 = new Rpt_PurchaseOrder3();
                }
                try
                {
                    object[] arguments = new object[] { dataPrint };
                    bool[] copyBack = new bool[] { true };
                    NewLateBinding.LateCall(obj2, null, "SetDataSource", arguments, null, null, copyBack, true);
                    if (copyBack[0])
                    {
                        dataPrint = (DataTable) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(DataTable));
                    }
                    if (strLanguage == "VIET")
                    {
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 1, modGeneral.H_ADDRESSVIET.Trim().ToUpper() }, null, null, null, true);
                    }
                    else
                    {
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, "") }, null, null, null, true);
                        NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 1, modGeneral.H_ADDRESSANH.Trim().ToUpper() }, null, null, null, true);
                    }
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 2, modGeneral.Tranlated("Email", strLanguage) + ": " + modGeneral.H_EMAIL }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 3, modGeneral.Tranlated("Điện thoại", strLanguage) + ": " + modGeneral.H_TELEPHONE }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 4, modGeneral.Tranlated("Fax", strLanguage) + ": " + modGeneral.H_FAX }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 5, modGeneral.Tranlated("ĐƠN ĐẶT H\x00c0NG", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 6, modGeneral.Tranlated("ĐẶT H\x00c0NG TỪ", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 7, modGeneral.Tranlated("Nh\x00e0 cung cấp", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 8, modGeneral.Tranlated("Số đơn đặt h\x00e0ng", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 9, modGeneral.Tranlated("Ng\x00e0y v\x00e0o sổ", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 10, modGeneral.Tranlated("Số tờ", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 11, modGeneral.Tranlated("ĐẾN", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 12, modGeneral.Tranlated("Giao h\x00e0ng tới", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 13, modGeneral.Tranlated("Điều khoản b\x00e1n h\x00e0ng", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 14, modGeneral.Tranlated("Hợp đồng", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 15, modGeneral.Tranlated("M\x00e3 vận chuyển", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x10, modGeneral.Tranlated("Điều khoản b\x00e1n h\x00e0ng", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x11, modGeneral.Tranlated("Thời gian giao h\x00e0ng", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x12, modGeneral.Tranlated("Điều khoản thanh to\x00e1n", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x13, modGeneral.Tranlated("ĐVT", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 20, modGeneral.Tranlated("M\x00f4 tả h\x00e0ng h\x00f3a", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x15, modGeneral.Tranlated("M\x00e3 h\x00e0ng", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x16, modGeneral.Tranlated("SL đặt", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x17, modGeneral.Tranlated("Đơn gi\x00e1", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x18, modGeneral.Tranlated("Th\x00e0nh tiền", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x19, modGeneral.Tranlated("(Ghi r\x00f5 họ t\x00ean)", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1a, modGeneral.Tranlated("Nh\x00e2n vi\x00ean đặt h\x00e0ng", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1b, modGeneral.Tranlated("Li\x00ean hệ", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1c, modGeneral.Tranlated("Tổng tiền", strLanguage) + "  (" + hang.LoaiTien.Trim() + ")" }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1d, modGeneral.Tranlated("Ph\x00ed phụ thu", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 30, modGeneral.Tranlated("Tổng thanh to\x00e1n", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x1f, modGeneral.Tranlated("Giao h\x00e0ng trước ng\x00e0y", strLanguage) }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x20, modGeneral.Tranlated("Thuế VAT", strLanguage).ToUpper() }, null, null, null, true);
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", new object[] { 0x21, modGeneral.Tranlated("Tổng tiền thuế", strLanguage) }, null, null, null, true);
                    arguments = new object[2];
                    arguments[0] = 0x22;
                    clsDMLoaiTien tien2 = tien;
                    arguments[1] = tien2.SoLe;
                    object[] objArray = arguments;
                    copyBack = new bool[] { false, true };
                    NewLateBinding.LateCall(obj2, null, "SetParameterValue", objArray, null, null, copyBack, true);
                    if (copyBack[1])
                    {
                        tien2.SoLe = (int) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray[1]), typeof(int));
                    }
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = RuntimeHelpers.GetObjectValue(obj2);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintPurchaseOrder5(string strKhoa, string strLanguage)
        {
            clsDonDatHang hang = new clsDonDatHang();
            clsDMDoiTuong tuong = new clsDMDoiTuong();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            hang.Load(strKhoa);
            DataTable dataHinhDongDau = tuong.GetDataHinhDongDau(hang.KhoaNhanVien);
            clsDMLoaiTien tien = new clsDMLoaiTien();
            tien.LoadByCode(hang.LoaiTien);
            DataTable dataPrint = hang.GetDataPrint(strKhoa, strLanguage);
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                if (dataPrint == null)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu!", ""));
                }
                if (dataPrint.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu!", ""));
                }
                Rpt_PurchaseOrder5 order = new Rpt_PurchaseOrder5();
                try
                {
                    order.SetDataSource(dataPrint);
                    order.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    order.Subreports[1].SetDataSource(dataHinhDongDau);
                    if (strLanguage == "VIET")
                    {
                        order.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        order.SetParameterValue(1, modGeneral.H_ADDRESSVIET.Trim().ToUpper());
                    }
                    else
                    {
                        order.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        order.SetParameterValue(1, modGeneral.H_ADDRESSANH.Trim().ToUpper());
                    }
                    order.SetParameterValue(2, modGeneral.Tranlated("Email", strLanguage) + ": " + modGeneral.H_EMAIL);
                    order.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", strLanguage) + ": " + modGeneral.H_TELEPHONE);
                    order.SetParameterValue(4, modGeneral.Tranlated("Fax", strLanguage) + ": " + modGeneral.H_FAX);
                    order.SetParameterValue(5, modGeneral.Tranlated("Hotline", strLanguage) + ": " + modGeneral.H_HOTLINE);
                    order.SetParameterValue(6, modGeneral.Tranlated("ĐƠN ĐẶT H\x00c0NG", strLanguage));
                    order.SetParameterValue(7, modGeneral.Tranlated("Gởi đến", strLanguage));
                    order.SetParameterValue(8, modGeneral.Tranlated("Người nhận", strLanguage));
                    order.SetParameterValue(9, modGeneral.Tranlated("Số đơn h\x00e0ng", strLanguage));
                    order.SetParameterValue(10, modGeneral.Tranlated("Ng\x00e0y", strLanguage));
                    order.SetParameterValue(11, modGeneral.Tranlated("Giao h\x00e0ng", strLanguage));
                    order.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y giao h\x00e0ng", strLanguage));
                    order.SetParameterValue(13, modGeneral.Tranlated("Số trang", strLanguage));
                    order.SetParameterValue(14, modGeneral.Tranlated("Mặt h\x00e0ng", strLanguage).ToUpper());
                    order.SetParameterValue(15, modGeneral.Tranlated("M\x00e3", strLanguage).ToUpper());
                    order.SetParameterValue(0x10, modGeneral.Tranlated("Số lượng", strLanguage).ToUpper());
                    order.SetParameterValue(0x11, modGeneral.Tranlated("Đơn gi\x00e1", strLanguage).ToUpper());
                    order.SetParameterValue(0x12, modGeneral.Tranlated("Th\x00e0nh tiền", strLanguage).ToUpper());
                    order.SetParameterValue(0x13, modGeneral.Tranlated("Tổng cộng", strLanguage));
                    order.SetParameterValue(20, modGeneral.Tranlated("Đ\x00e3 k\x00fd", strLanguage));
                    order.SetParameterValue(0x15, tien.SoLe);
                    order.SetParameterValue(0x16, hang.LoaiTien.Trim());
                    if (strLanguage.Trim().ToUpper() != "VIET")
                    {
                        order.SetParameterValue(0x17, modGeneral.Tranlated("Bằng chữ", strLanguage).ToUpper() + " " + hang.LoaiTien.Trim() + ": " + ConvertModule.AmtInWord(new decimal((hang.TienHangNT + hang.TienPhiNT) + hang.TienThueNT)).ToUpper());
                        order.SetParameterValue(0x18, LVYModule.DateLetter(LVYModule.Char2Date(hang.NgayChungTu), strLanguage));
                        order.SetParameterValue(0x19, LVYModule.DateLetter(LVYModule.Char2Date(hang.NgayCungCap), strLanguage));
                    }
                    else
                    {
                        string[] strArray = new string[5];
                        strArray[0] = modGeneral.Tranlated("Bằng chữ", strLanguage).ToUpper();
                        strArray[1] = " ";
                        strArray[2] = hang.LoaiTien.Trim();
                        strArray[3] = ": ";
                        double num2 = (hang.TienHangNT + hang.TienPhiNT) + hang.TienThueNT;
                        strArray[4] = Number2Char(num2.ToString(), ".").ToUpper();
                        order.SetParameterValue(0x17, string.Concat(strArray));
                        order.SetParameterValue(0x18, LVYModule.Char2Date(hang.NgayChungTu));
                        order.SetParameterValue(0x19, LVYModule.Char2Date(hang.NgayCungCap));
                    }
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = order;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintThanhToanNCC(string strKhoa)
        {
            clsThanhToan toan = new clsThanhToan();
            clsDMDoiTuong tuong = new clsDMDoiTuong();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            toan.Load(strKhoa);
            DataTable dataPrint = toan.GetDataPrint(strKhoa);
            if (toan.SoTienKhongPhanBo != 0.0)
            {
                DataRow row = dataPrint.NewRow();
                row[0] = "";
                row[1] = "";
                khoan.Load(toan.KhoaTaiKhoanDoi);
                row[2] = khoan.SoTaiKhoan;
                row[3] = "";
                row[4] = "";
                row[5] = toan.HinhThucThanhToan;
                if (toan.KhoaNganHang.Trim() == "")
                {
                    row[6] = "";
                }
                else
                {
                    tuong.Load(toan.KhoaNganHang);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        row[6] = tuong.TenViet;
                    }
                    else
                    {
                        row[6] = tuong.TenAnh;
                    }
                }
                tuong.Load(toan.KhoaDoiTuong);
                if (modGeneral.H_LANGUAGE == "VIET")
                {
                    row[7] = tuong.TenViet;
                }
                else
                {
                    row[7] = tuong.TenAnh;
                }
                khoan.Load(toan.KhoaTaiKhoanChu);
                row[8] = khoan.SoTaiKhoan;
                row[9] = "";
                row[10] = "";
                row[11] = 0;
                row[12] = 0;
                row[13] = 0;
                row[14] = toan.SoTienKhongPhanBo;
                dataPrint.Rows.Add(row);
            }
            string str = "";
            string val = "";
            if (toan.HinhThucThanhToan == "TM")
            {
                str = modGeneral.Tranlated("Tiền mặt", "");
            }
            if (toan.HinhThucThanhToan == "CK")
            {
                str = modGeneral.Tranlated("Chuyển khoản", "");
                val = modGeneral.Tranlated("Ng\x00e2n h\x00e0ng", "") + ":";
            }
            if (dataPrint.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_ThanhToanNCC nncc = new Rpt_ThanhToanNCC();
                try
                {
                    nncc.SetDataSource(dataPrint);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        nncc.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        nncc.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    nncc.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    nncc.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    nncc.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    nncc.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    nncc.SetParameterValue(5, modGeneral.Tranlated("THANH TO\x00c1N NH\x00c0 CUNG CẤP", ""));
                    nncc.SetParameterValue(6, modGeneral.Tranlated("Số chứng từ", "") + ":");
                    nncc.SetParameterValue(7, modGeneral.Tranlated("T\x00e0i khoản c\x00f3", "") + ":");
                    nncc.SetParameterValue(8, modGeneral.Tranlated("H\x00ecnh thức", "") + ": " + str);
                    nncc.SetParameterValue(10, val);
                    nncc.SetParameterValue(11, modGeneral.Tranlated("Đ\x00ednh k\x00e8m", "") + ":");
                    nncc.SetParameterValue(12, modGeneral.Tranlated("Diễn giải", "") + ":");
                    nncc.SetParameterValue(13, modGeneral.Tranlated("Nh\x00e0 cung cấp", "") + ":");
                    nncc.SetParameterValue(14, modGeneral.Tranlated("T\x00e0i khoản nợ", ""));
                    nncc.SetParameterValue(15, modGeneral.Tranlated("Số chứng từ ", ""));
                    nncc.SetParameterValue(0x10, "Ng\x00e0y " + LVYModule.sRight(toan.NgayChungTu, 2) + " th\x00e1ng " + LVYModule.sMid(toan.NgayChungTu, 5, 2) + " năm " + LVYModule.sLeft(toan.NgayChungTu, 4));
                    nncc.SetParameterValue(0x11, modGeneral.Tranlated("Tiền h\x00e0ng", ""));
                    nncc.SetParameterValue(0x12, modGeneral.Tranlated("Chiết khấu", ""));
                    nncc.SetParameterValue(0x13, modGeneral.Tranlated("Thuế", ""));
                    nncc.SetParameterValue(20, modGeneral.Tranlated("Ng\x00e0y ...... th\x00e1ng ...... năm ......", ""));
                    nncc.SetParameterValue(0x15, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    nncc.SetParameterValue(0x16, modGeneral.Tranlated("Tổng tiền", ""));
                    nncc.SetParameterValue(0x17, modGeneral.Tranlated("Thanh to\x00e1n", ""));
                    nncc.SetParameterValue(0x18, modGeneral.Tranlated("Tổng cộng", "") + ":");
                    nncc.SetParameterValue(0x19, "Bằng chữ: " + Number2Char(Conversions.ToString(Math.Round(toan.SoTienNT, 0)), ".") + " (" + toan.LoaiTien.Trim() + ")");
                    nncc.SetParameterValue(0x1a, modGeneral.Tranlated("Ng\x00e0y", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = nncc;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public static void PrintXuatChuyen(string strKhoa)
        {
            double soTien = 0.0;
            clsXuatChuyenKho kho = new clsXuatChuyenKho();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            DataTable dataReportDetails = kho.GetDataReportDetails(strKhoa);
            soTien = kho.SoTien;
            Rpt_XuatChuyenKhoChiTiet tiet = new Rpt_XuatChuyenKhoChiTiet();
            try
            {
                tiet.SetDataSource(dataReportDetails);
                if (modGeneral.H_LANGUAGE == "VIET")
                {
                    tiet.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                }
                else
                {
                    tiet.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                }
                tiet.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                tiet.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                tiet.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                tiet.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                tiet.SetParameterValue(5, modGeneral.Tranlated("PHIẾU XUẤT CHUYỂN KHO", ""));
                tiet.SetParameterValue(6, modGeneral.Tranlated("Ng\x00e0y", "") + " :");
                tiet.SetParameterValue(7, modGeneral.Tranlated("Số chứng từ", "") + " :");
                tiet.SetParameterValue(8, modGeneral.Tranlated("Kho xuất", "") + " :");
                tiet.SetParameterValue(9, modGeneral.Tranlated("Kho nhập", "") + " :");
                tiet.SetParameterValue(10, modGeneral.Tranlated("Người giao", "") + " :");
                tiet.SetParameterValue(11, modGeneral.Tranlated("Người nhận", "") + " :");
                tiet.SetParameterValue(12, modGeneral.Tranlated("Diễn giải", "") + " :");
                tiet.SetParameterValue(13, modGeneral.Tranlated("M\x00e3 h\x00e0ng", ""));
                tiet.SetParameterValue(14, modGeneral.Tranlated("T\x00ean h\x00e0ng", ""));
                tiet.SetParameterValue(15, modGeneral.Tranlated("ĐVT", ""));
                tiet.SetParameterValue(0x10, modGeneral.Tranlated("Quy c\x00e1ch", ""));
                tiet.SetParameterValue(0x11, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                tiet.SetParameterValue(0x12, modGeneral.Tranlated("Người lập biểu", ""));
                tiet.SetParameterValue(0x13, modGeneral.Tranlated("Người giao h\x00e0ng", ""));
                tiet.SetParameterValue(20, modGeneral.Tranlated("Thủ kho", ""));
                tiet.SetParameterValue(0x15, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                tiet.SetParameterValue(0x16, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", ""));
                tiet.SetParameterValue(0x17, modGeneral.Tranlated("Số lượng", ""));
                tiet.SetParameterValue(0x18, modGeneral.Tranlated("Đơn gi\x00e1", ""));
                tiet.SetParameterValue(0x19, modGeneral.Tranlated("Th\x00e0nh tiền", ""));
                MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = tiet;
                MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                if (Form.ActiveForm != null)
                {
                    Form.ActiveForm.Cursor = Cursors.Default;
                }
                MyProject.Forms.Frm_ViewReport.ShowDialog();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                ProjectData.ClearProjectError();
            }
        }

        public static void PrintXuatKhoHang(string strKhoa)
        {
            clsXuatKho kho = new clsXuatKho();
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            double num = 0.0;
            string strTKNo = "";
            string strTKCo = "";
            clsDMDonViBoPhan phan = new clsDMDonViBoPhan();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(strKhoa);
            num = (kho.TienHangNT + kho.TienThueVATNT) - kho.TienChietKhauNT;
            DataTable dataPrintPhieuXuat = kho.GetDataPrintPhieuXuat(strKhoa);
            if (dataPrintPhieuXuat.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                phan.Load(kho.KhoaBoPhan);
                kho.GetSoTaiKhoan(strKhoa, ref strTKNo, ref strTKCo);
                Rpt_PhieuXuatKho kho2 = new Rpt_PhieuXuatKho();
                try
                {
                    kho2.SetDataSource(dataPrintPhieuXuat);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        kho2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        kho2.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    kho2.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    kho2.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    kho2.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    kho2.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    kho2.SetParameterValue(5, modGeneral.Tranlated("PHIẾU XUẤT KHO", ""));
                    kho2.SetParameterValue(6, modGeneral.Tranlated("Số :", ""));
                    kho2.SetParameterValue(7, modGeneral.Tranlated("Nợ", "") + ": " + strTKNo);
                    kho2.SetParameterValue(8, modGeneral.Tranlated("STT", ""));
                    kho2.SetParameterValue(9, LVYModule.DateLetter(LVYModule.Char2Date(kho.NgayChungTu), "VIET"));
                    kho2.SetParameterValue(10, modGeneral.Tranlated("T\x00ean h\x00e0ng", ""));
                    kho2.SetParameterValue(11, modGeneral.Tranlated("M\x00e3 h\x00e0ng", ""));
                    kho2.SetParameterValue(12, modGeneral.Tranlated("Số lượng", ""));
                    kho2.SetParameterValue(13, modGeneral.Tranlated("STT", ""));
                    kho2.SetParameterValue(14, modGeneral.Tranlated("T\x00ean h\x00e0ng", ""));
                    kho2.SetParameterValue(15, modGeneral.Tranlated("ĐVT", ""));
                    kho2.SetParameterValue(0x10, modGeneral.Tranlated("Th\x00e0nh tiền", ""));
                    kho2.SetParameterValue(0x11, modGeneral.Tranlated("Đơn gi\x00e1", ""));
                    kho2.SetParameterValue(0x12, modGeneral.Tranlated("L\x00fd do xuất kho: " + kho.DienGiai, ""));
                    kho2.SetParameterValue(0x13, modGeneral.Tranlated("Thủ kho", ""));
                    kho2.SetParameterValue(20, modGeneral.Tranlated("Gi\x00e1m đốc", ""));
                    kho2.SetParameterValue(0x15, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    kho2.SetParameterValue(0x16, modGeneral.Tranlated("(ghi r\x00f5 họ t\x00ean)", ""));
                    kho2.SetParameterValue(0x17, modGeneral.Tranlated("Tổng cộng :", ""));
                    kho2.SetParameterValue(0x18, modGeneral.Tranlated("Họ t\x00ean người nhận h\x00e0ng", "") + ": " + kho.NguoiGiao);
                    kho2.SetParameterValue(0x19, modGeneral.Tranlated("C\x00f3", "") + ": " + strTKCo);
                    kho2.SetParameterValue(0x1a, modGeneral.Tranlated("Người lập phiếu", ""));
                    kho2.SetParameterValue(0x1b, modGeneral.Tranlated("Người nhận", ""));
                    if (modGeneral.H_LANGUAGE.Trim() == "VIET")
                    {
                        kho2.SetParameterValue(0x1c, modGeneral.Tranlated("Bộ phận", "") + ":" + phan.TenViet);
                    }
                    else
                    {
                        kho2.SetParameterValue(0x1c, modGeneral.Tranlated("Bộ phận", "") + ":" + phan.TenAnh);
                    }
                    kho2.SetParameterValue(0x1d, modGeneral.Tranlated("Ng\x00e0y ..... th\x00e1ng ..... năm ................", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = kho2;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }
    }
}

